I would need more context to decide if it's offensive. Jillio gave two contexts that would change the offensiveness of the question. People who are okay with gay people ask casually if other people are gay all the time. It's just a question out of genuine curiosity.
On the other hand, coming...