A while after coming to terms with my own gender (it took a while to come to terms with because it didn't match my sex), I got pretty interested in working out what gender actually was. The meaning of the word has evolved a lot since the most recent dictionary I can find, and while everyone seems to instinctively have a vague idea of what it is, if you were to ask someone, they probably wouldn't be able to give a simple, articulate answer.
It's somewhat easier to say what gender isn't: it isn't the kind of clothes you wear (transvestites are quite happy with their gender, as are drag kings and queens); it isn't your body's primary or secondary sexual characteristics (transsexuals are people whose gender and sex don't match, so they can't be the same thing); it's not what you were raised to be, as David Reimer inadvertently proved; it's not your sexuality and it's not a combination of the above. While people may lean towards certain characteristics due to their gender, no single one can by any means be used to determine someone's gender.
It's also not necessarily male or female, as many intergendered people can attest to. Despite what people are taught from a very early age, it isn't a dichotomy.
So what is it? There must be a short, simple definition.
I read a bunch of books, namely Gender Outlaw: On Men, Women, and the Rest of Us by Kate Bornstein, Read My Lips: Sexual Subversion and the End of Gender by Riki Anne Wilchins, and and Sexing the Body: Gender Politics and the Construction of Sexuality by Anne Fausto Sterling. They seemed to pretty much conclude that gender's a social construct which doesn't really exist. While that may be true in some sense, I knew my whole life what gender I was, and that it didn't match my sex. I wasn't looking for vague ideas of how to act that society imposed on people based on superficial observations of their appearance. I was looking for the part of me that I instinctively knew about. Whatever gender was, it had compelled me to spend a great deal of time, effort and money on making my sex closer resemble it, so it must have existed in some sense.
I think I've finally spent enough time thinking about gender to reach some sort of conclusion about what it might be. A simple definition. I don't know if it's right, but I doubt many other people have come up with a better answer yet. Hopefully someone will.
Gender is the sex your mind believes your body should be.
That's it. That's the most fundamental definition I can give. It's possible that an even simpler answer exists, such as "gender is your brain's sex," but at the moment it's not very practical to try and prove such a statement: as far as I know, the best attempt at proving a brain's sex with current technology involves slicing a corpse's hypothalamus up very precisely.
So that's the best definition I have so far.