Transgender and transexual (question)

I thought that gender was a "identity" that society creates for men and women based on their sexes (if you're a man you must do this and this, and if you're a woman you must do that and that)

What you're describing are gender roles, which are not the same thing as gender. Gender roles (men should do x, women should do y) are largely a product of socialization; gender (I am a man, I am a woman) is a real thing that comes from inside of people. "Gender identity" is a more explicit way of describing gender.

the difference between transgender and transexual

"Transgender" is an umbrella term that describes anyone whose gender identity does not match the gender they were assigned at birth. This includes trans women ("MTF" trans people), trans men ("FTM" trans people), genderqueer people, agender people, and several other non-binary (neither man nor woman, or both man and woman) sorts of people. A person can be transgender regardless of whether they currently live as their identified gender, regardless of whether they've had surgery, etc. It's based solely on the gender they identify with versus the gender they were assigned.

"Transsexual" is kind of an ambiguous word with several definitions, but it seems like it most commonly refers to binary trans people (trans women and trans men) who live as their identified gender and/or have had medical intervention to that end. Some definitions also require the person to have had bottom surgery.

Regardless of the exact definition, "transsexual" is a type of "transgender". You can be transgender without being transsexual, but you can't be transsexual without being gender.

Anyway, even though "transsexual" is a word that a lot of cis (non-trans) people recognize, and historically it has also been used by doctors and therapists to describe trans people, younger (English-speaking) trans people don't seem to care for it much. It sounds clinical and emphasizes "sex", which is a problem given that a lot of cis people think trans people are deviants or something. "Transgender" is the most commonly used adjective, and "trans people" (or "trans women" or "trans men") is the most commonly used noun.

/r/asktransgender Thread