I agree with Mandylion that status in the international community is very important to the Japanese. I believe the same can be said of Korea and China.

Japanese people are well-known for being insecure. I hear the word "fuan" 不安(insecurity, angst...) all the time, while there is not even a direct translation in English or French.

That's a very good point to link questions like "Do you have this in your country" with the sense of insecurity. Now that I think about it, there is probably a strong causal link. That's also why the Japanese feel a need to tell foreigners that their country and culture are so great. One of the first questions foreigners are asked by almost any Japanese are "What do you think of Japan ?" and "Do you like Japanese food ?". Why ? Because they are anxious to get foreign approval of their country and culture. That's probably why whenever a Japanese asks me "Do you have this in your country ?" and I say yes (or worse, it comes from my country or from that other country originally), then feel even more insecure and need to ask about other stuff until finally I say "no". Then they can proudly say "haha, we Japanese have this and you don't !". Sounds very childish, but that's probably a way of satisfying their insecurity.

What's more, the Japanese tend to have a love-hate relationship wit Westerners (which is usually reciprocal). More accurately, they admire Western people, cultures and countries so much that they want to copy everything; not just systems, and technologies, but fashion, hairstyles (even colour), food, vocabulary, and some go as far as to get surgical operations of the eyelids to get a "third fold" to look more "Caucasian". That's also why Japanes girls are so fond of Western men. This further enhance the feeling of insecurity and worthlessness among some Japanese men. The same trend is also apparent in modern Chinese cities like Shanghai or Beijing (and even in South-East Asia, but a bit differently for economic reasons).

So racism is maybe a way for some Japanese to become more confident, by doing all they can to make "gaijins" look stupid or inferior, going as far as inventing theories such as Japanese having unique brains, being able to eat food that foreigners can't eat, or claiming that Japan is unique for its four seasons and cherry blossoms, or other narrow-minded (and deeply mistaken) nationalistic propaganda. That's also why they want to look superior to other East Asian countries, which they see (from outside) as politically and economically inferior to Western countries. Japan became a colonial power in the hope of reaching equality with the West. They still want to look superior nowadays - mostly because they measure the value of a culture or nation almost exclusively by economic success. That's why the Japan of the 1980's was more racist and arrogant than ever before, and why they fear China's economic growth, as it disturbs their status of "superior race" of Asia (eventhough they don't mind throwing away their own culture ).

What can be done ? Tell them that racism and nationalism will only have the opposite effect and create resentment and despise among foreigners ?