For many of us, history is something we are forced to do at school but become more interested in as we get older – whether through popular histories, novels about the Tudors, or genealogies of our own families. But for political leaders, history is a more serious business. In recent weeks, both the Russian President, Vladimir Putin, and our own heavy-handed education tsar, Michael Gove, have been demanding government-controlled, nationalistic school history syllabuses; both see history as an essential tool for forging national unity and shaping political attitudes.

David Cannadine's elegantly written and stimulating book is a useful reminder that some historians have been willing servants to political projects of all kinds. Just as medieval kings had their chronicler-propagandists and African chiefs had their praise-poets, so, in a more democratic age, Gove and Putin have their nationalist historians. And, it must be added, their opponents of all stripes, socialist, feminist and beyond, have also had their bards and academic cheerleaders.

But these are activities of which Cannadine strongly disapproves, arguing that historians have done much to divide humanity into "us and them" – though their particular ideas of who the "us and them" are has changed markedly. From the mid-19th century, nation was the most popular theme, and many historians dedicated themselves to showing how their particular nations were distinct from (and superior to) others. So "Whig" historians insisted on the supposedly ideal development of Britain's democratic institutions, while their American counterparts celebrated their nation's unique history of freedom.

The rise of European empires, however, brought another category to the fore, namely race, and from the 1880s, histories, bolstered by pseudo-scientific tracts, justified ethnic hierarchies. Yet, the catastrophe of the first world war, with its shattering revelations of European brutality, led historians such as Oswald Spengler and Arnold Toynbee to question the west's primacy, and see it as one of several competing "civilisations". This approach, echoed in Samuel Huntington's Clash of Civilisations of 1993, became a handy weapon in the neo-conservative armoury after 9/11, when it was used to justify a Manichean struggle between "Judeo-Christian freedom and democracy on the one side and Islamic despotism and tyranny on the other".

But Cannadine does not confine his criticisms to those historians who have wielded their pens in service of the mighty. Oppositional historians are castigated, too: both the Marxists of the 1960s and 1970s, and feminist and post-colonial historians in more recent decades, stand accused of peddling exaggerated dichotomies of class, race and gender, and overstating the significance of "difference" and subjugation.

Rather than perpetuating such false consciousness, Cannadine concludes that historians should adopt a self-denying ordinance and abandon their obsessive concern with such categories – whether national, religious, racial, civilisational, gender or class. They should focus not on what divides humanity but what unites it. For "the history of humankind is at least as much about cooperation as it is about conflict, and about kindness to strangers as it is about the obsession with otherness".

This may seem a well-meaning, if rather pious, sentiment, with which few could disagree. And Cannadine is justified in drawing attention to how dangerously politicised history can become. But his argument has its problems. First, many of the historians and intellectuals Cannadine cites represent only a small, polemical minority, eager to engage in political battles – people like Huntington, Betty Friedan or EP Thompson. In truth, most academic historians writing today are extremely wary of sweeping accounts of nations, classes or genders, stressing, instead, the many ways in which such identities ebbed, flowed, overlapped, were contested, reconstructed and remodelled over time. Indeed the relationship between history writing and politics is generally the opposite of the one Cannadine identifies: most historians are so careful, cautious and scrupulous, they can find it difficult to communicate their fine-grained and sensitively nuanced analyses to the broader public. This, unfortunately, leaves the field clear for the crude simplifiers and polemicists.

But Cannadine, despite his many caveats and qualifications, goes much further than most academic historians in challenging the centrality of tensions based on nation, class, ethnicity and gender. Indeed, his claim that "relations between the 'bourgeoisie' and the 'proletariat' have been characterised more in the long run by conversation, collaboration and cooperation than anger, antagonism and animosity" would make even Dr Pangloss gasp.

And while it may be true that some nationalist, feminist and Marxist historians have exaggerated the significance of their chosen group, it is difficult to deny that at certain times these identities have become extremely important political forces, and historians would be negligent if they failed to study them. So, however disparate and inconsistent Gandhi's nationalist movement may have been, it was undeniably a powerful force in mobilising ordinary Indians against the British. And in 1917 Petrograd, many workers did indeed believe they were engaged in a struggle with "bourgeois" oppressors.

Cannadine may be right to argue that such explosions are relatively rare, but less dramatic conflicts between social groups have been – and continue to be – important motors of historical change. Third-world nationalists played a major role in undermining European empires before and during the second world war, and American power during the cold war. And working-class political parties were crucial in forcing 20th-century European governments to create welfare states, while the social compromises of postwar Europe owed much to elite fears that workers would otherwise vote Communist.

So identities of class, nation, religion and gender are less figments of intellectuals' imaginations, dreamt up to divide humanity, than powerful political forces that are often rooted in real differences of power and status. That this continues to be the case is clearly recognised by politicians and advertisers, who spend millions on surveys and focus groups to discover how occupational class, gender, ethnicity and generation affect how we vote and what we buy. Contemporary pollsters may use a much more sophisticated definition of occupational class than the old Marxist historians, but they would never question that occupation is a central factor in shaping our attitudes.

Such divisions, then, cannot be glossed over. Historians, like other social commentators, must study them, for resolution of our differences is much more likely to come from understanding than from ignorance or denial.

Cannadine's overstatement of this case is strange, and the reader has the strong sense that his writing shares some of the shortcomings of the polemicists he is attacking, exaggerating one identity – in his case "common humanity" – at the expense of others. So does his proposed new history also serve some political purpose?

One clue lies in a statement from Margaret Thatcher, which he seemingly cites with approval: "Class is a Communist concept. It groups people as bundles, and sets them against each other." Thatcher was voicing the neoliberal belief that there are no fundamental differences of power within or between societies; we should compete as individuals devoid of group identities. Success or failure simply reflects personal abilities and virtues.

Cannadine's proposed history of humanity seems very compatible with these sentiments – though in many ways it would be more neoliberal than a Thatcherite history. For unlike Thatcher he would ditch even the identity of nation in favour of a globalised identity.

It is unlikely that Cannadine intends to promote a political agenda – he devotes more attention to criticising other historical approaches than to developing his own. But given his harsh judgments on the supposed politicisation of other historians' work, it is surely legitimate to apply the same analysis to him. His ideal history of a united humanity, free of class, ethnic and gender resentments and detached from religious and national identities, would certainly be welcomed by the global free-marketeers who wield so much power in the world today.