Pretty much self explanatory, often you seem to be getting on really good with a girl and she'll drop the "my boyfriend" statement, and then there's that awkward party where you do not know how long to continue talking to her.
Just ask her if she knows any guys that are into sports cause you have extra tickets to a sports game. If she says "no I don't know anyone" then usually that means she's single.
Otherwise just straight out and ask her. No use prolonging the question.
The comment below is a good idea because you don't want to see as if YOU want to know if she has a boyfriend because you want to make a move on her haha. Another thing you could do is say "hey isn't your boyfriend friends with Peter?" or any other name of one of your friends, that way you can follow on with a funny story for the reason you thought that without having that pause when she realizes you were fishing to find out if she had a boyfriend :D
Haha, yeah it stings when you hear that comment. If you want to find out without asking her direct, you can always go for the "well, what does you boyfriend think about that" line. It always works for me. :)