Translation:Why do your ears hurt?
I think this is the right way to say it:
"Ippanteki ni mimi ga itamu no riyuu ga ari masu ka?"
"In general, is there a reason why ears hurt?"
Or casually (and more specifically):
"Ippanteki ni mimi ga itamu no riyuu ga nani desu ka?"
"In general, what are the reasons why ears hurt?"
なぜ - why
耳 - ear
いたいん － いたい is a verb - "to hurt". Adding の turns いたい into a noun. Then の is shortened to just ん。You can also say 「なぜ耳がいたいのですか？」It's the same sentence, but afaik, japanese people tend to shorten things down and reduce unnecessary information from sentences, so that's why often the nominalizer の gets shortened down to just ん。
So, just like in english, you basically take the verb "to hurt" and turn it into a noun - "hurting". The same principle is in japanese.
You can also read more here: