"Are you a foreigner?"
what is the difference between gaikokujin and gaijin? I had always heard the latter before this course.
外人 is like "outsider" and sounds slightly rude in my opinion. Adding 国 makes it sounds like "a person from outside the country", which sounds better
Is this a common question in 日本? In the US (at least in my experience), it seems pretty rude to ask somebody directly if they're a foreigner. Most of the time, you can infer that yourself based on accent/appearance/etc. and then you might ask something like "I notice you have an accent. Where are you from?".
In my experience, it's not common at all to be asked directly if you are a foreigner. I have personally had this exact sentence directed at me a couple of times, but it's always when someone is surprised to learn that I'm not Japanese (I have Asian features, often being mistaken for a Japanese person, and I have enough Japanese to pull it off for a little while at least).
However, it's also worth noting that this question can mean "is he/she a foreigner", in which case it's a lot more frequently used.