It's as inappropriate as asking someone's age, sexuality, religion, caring responsibilities, pregnancy status etc. Only wholeheartedly sexist people will have a simple answer, the rest of us will have a quite complex understanding of a balance of factors affecting issues of our obvious awareness of what sex we are nuanced by the extent to which the sexism of our upbringing and society has either made us accept or reject ideas of gender (with a mixture of the two for most people) and really that's not a conversation that it's appropriate to have with someone you have only just been introduced to.