Only by asking them! If they choose not to tell you, or if they lie, then there is no way you can find out from MUD. It is considered "bad form" to ask this kind of question of someone unless you've got to "know" them quite well in the game, by chatting to them about game-related things.
Since MUD is insulated from the real world, people often use the game to role-play, since it lets them be anything they feel like being. If you see a character called Helga walking around shpeaking mit ein cherman accent, it doesn't mean she's really German, or that she's called Helga, or indeed that she's female in the real world. In MUD, you just have to take people as you find them!