So, there's a guy in one of my classes who I think might be gay. Though, I'm not sure how exactly to ask him without making it seem like I'm interested in him.
you can always take an indirect approach. Talk about some recent LGBT news, marriage equality, non discrimination, or something like that. Its always a good ice breaker.
Get to know him first. . In the future, if you get the chance, then talk about gay-related things and then see where it goes. Don't just straight up ask him.
You shouldn't! That's something personal and you have no right. If the said person -feeeeels- like sharing it with you then it's fine. But asking? What if he isn't ready to give you an answer? What if your question confuses him or embarrasses him? A friend of mine asked me once and I felt angry that he did. I, personally, wouldn't ask someone that.
if you know a close friend of his, ask them in private. if they say they don't know or seem hesitant just never mind it. watch their actions. and there's no shame in asking someone, but remember that it's a sensitive subject. but i probably don't need to remind you of that.
Another person above gave good advice that I forget sometimes. Checking him out on social media and stalking him online lol. This is a very tough issue. Dealing with being attracted to a guy you are close with, but not knowing if he is gay or straight. Even though it's kinda sneaky and shady, yes check him out on facebook and get your answer from that. If not, then just talk to him and start to deduce that. Ask if he has ever had girlfriends, if he likes stereotypical gay stuff. etc. Sooner or later you are eventually going to have to ask him bluntly, and let it be known.
Past relationships should be a good clue as to how many people he's dated and for how long. He probably won't disclose that kind of information since that is quite personal. If he asks you about your past relationships, then you could reveal that you've had/never had a boyfriend. But don't just walk up to him about it, let the conversation easily flow in. It's easy to mistaken someone just from looking afar.
If you're not interested in him there is no reason for you to invade his privacy and ask him. And I don't just mean in a sexual sense; you have no business knowing his sexuality unless he wants you to know.