Occasionally, the topic arises of how to write a male or female character authentically when the author is of the opposite gender - and the inevitable (and ultimately, accurate - if simplified) retort is, "Don't write a gender: write a person." And this is all well and good; it helps break those grating stereotypes we're all tired of seeing. However, there's one aspect in which you can't ignore gender, unless you're writing about a very exotic society with a culture structure at odds with ours: how other people react to them.
This comes to mind because I'm re-editing "Traveling By Starlight: A Journey of Two Ways" ... a story of mine with two alternate (and mutually exclusive) endings. In one conclusion (this is only a minor spoiler!) the first-person narrator is female; in the other ending, the details of the story are seen in another light, and the narrator is male.
When I put this story up for critique initially, I asked readers what gender they thought the narrator was (before the divided endings) and why. Most of them pegged Verel as female not due to anything the character said or did, but due to how the love interest (male, which probably also contributed, though no one said as much) interacted with the character. Verel gets a minor injury, and in the original draft, the love interest was worried about it. I ended up rewriting his reaction and dialing back a few other comments throughout.
So again, unless your society has been radically restructured or gender simply doesn't exist, it's going to be hard to avoid tackling the topic of how other characters treat someone of male or female gender. This sometimes leads to obnoxious extremes, where secondary characters pound the reader over the head with, "Oh, wow, a girl isn't supposed to do that! How shocking / awesome / unusual!" Done right, though, society's mirror is a key facet of depicting male-or-female ... even when the individual defies all conventions.