Not in class, I hope.
To me, gender is the physical maleness or femaleness of a person. Sex is an activity. I suspect that the dislike some people have for the use of the word "gender" to mean a physical attribute is regional. It's similar to the annoyance I feel when some Marylander uses the word "tag" to mean "license plate", which is what we called it in CA, where I grew up.
In any case, a person cannot change gender. Either he is biologically male, or she is biologically female--either way, the gender is an immutable fact, not subject to personal decisions.
//To me, gender is the physical maleness or femaleness of a person. Sex is an activity//
Which is what the libs want you to think. However, gramatically it is incorrect.
Reaganaut is correct. Gender only refers to words and grammar. The proper term for maleness and femaleness of humans is “sex” not “gender”.