Translation:Are you Mexican?
Very small point - "Are you a Mexican?" would be understood in English, but adding the "a" gives it an odd-ish twist. Adding the "a" or "an" in relation to occupation or sports ("Are you a lawyer", "Are you a soccer player") or affiliation ("Are you a Republican?") is common, but with nationalities or religious affiliation ("Are you a Catholic?"), "a" or "an" isn't as common.
There is no rule for it; you just have to memorize which words take which sound. Some «x»s are like (in IPA) [x] (depending on where you are from either [h] like in English, or like the „ch“ in German „ach“): «México, mexicano, etc.». Others are like [ks], such as «éxito, examen, experto, sexto, etc.». It can even make the [t͡ʃ ] sound, the Spanish «ch» sound, in some proper nouns like «Xitle, Xela, etc.».
In Spanish, it is only these three sounds, but English has a few alternate sounds for "x," and Portuguese even has five different ways to pronounce it. :D
A little of history.
The X used being a spanish J in the old times. Nowadays it has changed and mostly words have a J instead of a X (for example, Don Quijote used being spelled as Don Quixote).
Mexico keeps its X for tradition. We just accostumed to read it and spell it that way for 500 years (the same apply to many cities and towns in Mexico, that were founded or discovered in the XVI).
The RAE accepts Mexico with J, but personally, it makes our eyes bleed.
The "X" can be "H" or "KS" or "SH". There's no rule. I still wonder how to pronounce the names Xavier/Ximena/Xavi and is it Ximena or it's Jimena??? Some people pronounce Xavi as Shavi. But as ZuMako8_Momo said, the "X" used to be the Spanish "J" once upon a time. In my language (Bulgarian) and in other Slavic languages, our "H" is "X". And when we say "hahaha" we write it "xaxaxa" but the "x" there is "h".
Just got this question on studies. Since I was born American some 70 years ago, I quickly answered w/o thinking "Are you American" which is only one country to the south, but still wrong. What'd know..... did they mark me wrong? Nope, gave me an Correct answer response! Honest mistake if transaction is between humans, but assume I'm dealing with auto response robots..... FEED BACK PLEASE