They don't change gender. Some males are late developers and look like females for a long time, and very old females can take on male characteristics, but they don't actually change sex.
I've got a "gender confused" black phantom tetra. She clearly has the red finnage of a female, but her behaviour is like that of the males - being territorial and having "fin-offs" with the guys. Her body is also noticeably darker than the other females who have a slightly ruddy hue to the body. It doesn't help that my daughter has named her Mr Froggy.