A human is born one sex or the other depending on the chromosomes inherited from the parents. Even a surgical sex change, can't enable a man to produce eggs or a woman to produce sperm.
But several kinds of fish not only can change sex, but do so as part of their normal reproductive cycles...
Sex-Changing Fish
In most sex-changing fish, nearly all the young are born female and as they grow up, some become male. In others, the change goes from male to female.
Either way it goes, the sex change works with the lifestyle of that particular fish to produce the largest number of offspring.
How It Works
Fish that change from female to maleincluding parrot fish, sea bass, and groupersusually live in groups of one male and several females.
Since the males guard their groups against other males, a small fish is more likely to reproduce if it's female. But when the male dies, the largest female takes on the male coloration, develops testes, and can even produce sperm, so becoming the male in the group.
Male To Female, Female To Male
But in other fish, all are born male and the largest ones turn into females. These fish usually mate in pairs. Since a large amount of sperm can be produced by a small animal, the size of the female determines how many fertilized eggs one pair can produce.
So, when the fish are young and small, they're male and produce sperm, but when they get bigger, they become female and produce eggs.
Evolutionary Advantage
No one knows exactly how the sex change occurs, but in either direction, the ability to change from one sex to the other seems to have distinct evolutionary advantage by enabling the species to produce the largest number offspring possible.