On 18 February 1943, Joseph Goebbels, Hitler's minister of propaganda, took to the stage at Berlin's sports palace calling for "total war". "Two thousand years of western civilisation are in danger," he said, before going on to blame his favourite scapegoat. "Things have gone so far in Europe that one cannot call a danger a danger when it is caused by the Jews."

Seventy years later, on the same spot, stands a housing estate called the Pallasseum, whose facade of vividly coloured satellite dishes and various flags hanging from balconies reveals how far Europe has come from Goebbels's moribund concept of "western civilisation".

Around 40% of the inhabitants are German, 40% of Turkish extraction and 20% hail from elsewhere, ranging from Bangladesh and Somalia to Australia and France. The different communities don't always mix, but neither do they clash.

Across the road, on the ground floor of the youth club used by many young people on the estate, a dance class led by a Mexican teacher is about half white-German and half a mix of various nationalities and ethnicities. On the second floor, younger children, mostly of Turkish extraction, play pool and post updates on Facebook. The next floor is a hangout for local punks and goths, who are all white. For a long time the children on the second floor thought they were racists, and the punks and goths thought the youngsters were potential Islamist militants. One of the centre's organisers, Annette Maurer-Kartal, set up a correspondence course between the two floors so that they could get to know each other better. "There's not a lot of tension here, but there's also not necessarily a lot of contact," says Maurer-Kartal, a social worker for the neighbourhood association. "People can lead quite separate lives."

Throughout Germany, tensions around issues of race, religion and national identity have been growing. Earlier this month, following a gun attack allegedly carried out by a 21-year-old Muslim immigrant from Kosovo at Frankfurt airport in which two US servicemen were killed and another two injured, the interior minister, Hans Peter-Friedrich, said Islam "did not belong in Germany". In October the chancellor, Angela Merkel, said the nation's "multi-kulti" project had been a complete failure.

Her comments were, in part, a response to a publishing sensation: Deutschland Schafft Sich Ab (Germany Is Doing Away With Itself) by Bundesbank board member Thilo Sarrazin. In apocalyptic terms, Sarrazin, a Social Democrat, conjured a future where Turks (around 5% of the population) compete to outnumber Germans, thereby "dumbing down" the country with their inferior gene pool. Blaming inbreeding among Turks and Kurds for "congenital disabilities", Sarrazin claimed immigrants from the Middle East are a "genetic minus" for the country. "But the subject is usually hushed up," he wrote. "Perish the thought that genetic factors could be partially responsible for the failure of parts of the Turkish populations in the German school system."

If the argument appalled some, the public response stunned everyone. Currently in its 14th edition, it is Germany's bestselling book since the second world war. A poll published in the national magazine Focus in October showed 31% of respondents agreeing that Germany is "becoming dumber" because of immigrants; 62% said Sarrazin's comments were "justified".

"Sarrazin didn't say anything new, didn't break any taboos and didn't contribute anything to the debate," said Mekonnen Mesghena, head of migration and intercultural management at the Heinrich Böll Foundation. "But what was really shocking were the number of intellectuals who said: 'His tone wasn't right but he has a point.' "

Back at the Pallasseum, Zelika Baba, 32, who works at the youth club, pauses after prising one of the children away from his Facebook page to reflected on what integration means to her.

"Integration is supposed to be give and take," says Baba, who is of Kurdish and Aramaean descent. "But they just want us to give up our culture. It doesn't matter how long you've lived here – whether you were born here or whether you speak German – you're always a foreigner. They talk about us, but they never talk with us."

Much of the German debate about immigration, race, religion and national identity is consistent with the moral panics that have swept through Europe over the past two decades. The economic and social realities are fairly similar too. A report by the Berlin Institute for Population and Development in 2009 revealed that Turks were the least well integrated community. Unemployment among them is 11% (compared with 6.5% nationally) and only 14% pass their final secondary school exam.

Like the rest of Europe, the Turks have their self-avowed apostates such as Necla Kelek, a Turkish-born sociologist and author who has led much of the criticism about the failure of her people to integrate. There are burgeoning cultural voices such as Melda Akbas, who wrote a book called As I Please: My Life Between the Mosque and the Miniskirt. And there are individual success stories such as Cem Ozdemir, the co-chairman of the Greens and Europe's first non-white leader of a mainstream party.

Nationalist mythologies, compounded by poverty and discrimination, underpin a widespread anxiety that has shifted its focus from race to religion and colour to culture. People of Turkish descent make up about 6% of the population. Two-thirds of them have German citizenship. They were once the scapegoat, but now it is the Muslims.

"After 9/11," said Barbara John, Berlin's former migration and integration commissioner, "religion became the determining explanation for everything Turkish people did."

But the German conversation differs in several ways and for several reasons. First, there is the burden of German history, particularly the Holocaust, which makes discussions of national identity and racial difference sensitive.

"For a long time, to be German was a broken identity," said Mesghena, who came to Germany as a refugee from Eritrea in the 1980s. "No other European nation went through their history as critically as they did here. But for a long time it was a broken identity. Nobody wanted to be German, and this was a real challenge for those people who came into this country. How can you become part of a country that was not comfortable with itself?"

This insecurity does not eliminate racism, but it may have suppressed the confidence to articulate it and certainly thwarted efforts to organise electorally around it. Germany is one of the few European countries without a strident far-right party.

It has also created a defensiveness in engaging with issues of race that owes more to angst than analysis. At Berlin's Soho House, Rose-Anne Clermont, a Haitian-American, read from her new book Buschgirl, which chronicles her experiences since she first came to Berlin in 1998. She has now settled there and started raising a family. When she mentioned that she is always, at first sight, presumed to be African and never assumed to be German, an audience member interrupted to insist that this was not true and, if it were, then it could only be true for less educated Germans. "They want to get rid of their image of being xenophobic and racist, but they still want to hold on to their entitlement," she said afterwards.

When she did an interview about her book, the quote that was extracted and then circulated widely on the internet was: "Germans are not racist. They are inexperienced." "I said many things, including that," explains Clermont. "But clearly that was what they wanted to hear. The level of debate is really not that sophisticated here."

The next day, as I entered the Kaufhof department store in Alexanderplatz, two schoolchildren doing a project on foreigners approached to ask me some questions. I obliged. Afterwards I asked how they knew I was foreign. They shrugged.

These issues were further complicated by reunification, which brought with it a spike in racial violence in the east - which still has "no-go zones" where non-white people fear to venture - and yet more national introspection.

"It's no coincidence that this debate broke out around the 20th anniversary of reunification," said Patrick Bahners, features editor of Frankfurter Allgemeine Zeitung and author of The Panic Makers, which offers a critique of Sarrazin's book in particular and Germany's paranoid attitude to Islam in general. "Today you hear people saying we should finally show some self-confidence again and that it is only a sense of guilt regarding our history that keeps us in bondage. That used to be reserved for the extreme rightwing. Now it is mainstream. In many ways this debate tells you more about Germany than it does about immigrants."

For most of the postwar period, a more complex conversation was stunted by the country's contradictory attitude to immigration. On the one hand, like most European countries, Germany invited and accepted large numbers of migrant workers after the war – mostly from Turkey. But unlike others, it took Germans several decades to come to terms with the notion that they might stay. So even as the labour force and cities were transformed by migration, the official line was that Germany was not an "immigration country" and that these were only gastarbeiter – guestworkers. This was enshrined in its immigration law, based on jus sanguinis (the right of blood) rather than jus soli (the right of soil): only those with German parents could become German, leaving the children and grandchildren of immigrants, who were born in Germany, foreigners in the only country they knew.

None of the German-born children of migrants I spoke to felt they would ever be fully accepted as German. "There is no way to really 'become' German unless you have German parents," said Füsun Türetken, a PhD student whose parents are Turkish. "The few who are invited to fully participate are accepted with an understanding that they cannot criticise German Christian culture and that if they succeed they are German and if they fail they are Turkish or Muslim." This law changed in 2000, allowing people born in the country to claim German citizenship. The national mindset, said Mesghena, has yet to catch up. "This issue of biological ethnicity is still very vivid," he says. "Rationally people know it has changed but emotionally they haven't processed those changes. We never had a policy of multiculturalism. We had a policy of denial. Denial of immigration and of diversity. Now it's like we are waking up from a long trance."

• This article was amended on 16 March 2011. The original referred to Mekonnen Meshgena. This has been corrected.