Who said race isn't fluid? With each generation that passes, we can have inter-racial descendants.
If someone has great-grandparents of 8 different races, determining race isn't so black and white.
America "solved" that problem for blacks with the "one drop of blood" policy, with several states codifying it into state law in the early 20th century. There was no similar rule for any other race.
Pretending to be a race you have no claim to, for some kind of personal advantage, should be viewed as fraud.
Is it as simple as skin color? Black albinos don't have black skin, but often still identify as black. Tragically, they are can often be rejected by both black and white communities.
Determining sex is usually straightforward, but there are often complications. There are three inter-related elements: biological sex, sexual preference, and self-identification. Usually, they all align with each other, with men feeling and looking like men, and liking women, and vice-versa. Yet ambiguities often arise:
- physical appearance can be ambiguous, with the presence of both male and female characteristics.
- chromosome determination is complicated by factors like a failure to respond to hormones during development, or sometimes the presence of a third sex-chromosomes.
- sexual preference is often not black or white -- anyone, regardless of physical appearance, or chromosomes, can prefer men, or women, or both (or neither I suppose). This is not a conscious choice, but an internal preference, much like bananas can be a favorite food to one, but makes me gag. In studies, when there is a a gay twin, there is a 50-50 (or at least higher) chance the other twin is gay, suggesting a genetic component, but also other non-genetic factors.
- self-identification is the one that seems to confuse most of the society who fear differences they don't understand. It can result in situations where a man looks like a man, and likes women, but something still feels wrong, and they claim to be "lesbians trapped in a man's body". I can't begin to explain this any further, but will just note that it happens often enough that there must be some complex psychological reality.
The two things both of these things have in common, is that the problems are not confined to how specific individuals view themselves, but how society accepts and treats that individual, in all aspects of life, and sometimes death.