The mating system of the gobiid fish Trimma okinawae is one of polygynous hermaphroditism, in which the largest female of a social unit changes sex following the removal of the dominant male. Histological observations of the gonads however, revealed that males have an ovarian tissue within a functional testis. The occurrence of ovarian tissue in the functional male suggests that T. okinawae males should be able to revert back into being functional females. To test this prediction, we placed females in an aquarium and allowed them to change sex. After confirming sex change from female to male, we individually placed new males into another aquarium and added a larger male to each. Our experiments revealed that females change sex and become males upon the removal of dominant males, and that those males changed sex again and became females in the presence of larger males. Sex change in both directions may be advantageous when a male is forced to become subordinate following the take over of the social unit by a larger male.