The saying originated during the nineteenth century in the United States, where people wanting a physical fight would carry a chip of wood on their shoulder, daring others to knock it off. Printed citations of this include the Long Island Telegraph, a New York newspaper, which on May 20th, 1830, printed "When two churlish boys were determined to fight, a chip would be placed on the shoulder of one, and the other demanded to knock it off at his peril."
A similar notion is mentioned in the issue of The Onondaga Standard of Syracuse, New York, on 8th December 1830: “‘He waylay me,’ said I, ‘the mean sneaking fellow — I am only afraid that he will sue me for damages. Oh! if I only could get him to knock a chip off my shoulder, and so get round the law, I would give him one of the soundest thrashings he ever had.’”
Some time later, in 1855, the phrase "chip on his shoulder" appeared in the Weekly Oregonian, stating "Leland, in his last issue, struts out with a chip on his shoulder, and dares Bush to knock it off."
Usage over time changed, now suggesting somebody who shows a belligerent attitude, acting as though they are asking for a fight. The chip is now figurative, but the idea remains the same.
In Britain this is often used in the context of a media personality or politician who drones on about their "working class roots" from a position of power and authority.
In Ireland the joke is made about "The well balanced Irishman : a chip on both shoulders". This is someone who has an endless supply of current and, more often historical, socio-political injustices to complain about. It is quite probable that all these are true; but the perception that the individual never misses an opportunity to raise these issues, often combined with the perception that they have never suffered these injustices themselves, leaves the person open to satire.
The tenth song in Legally Blonde: The Musical is entitled "Chip On My Shoulder". The song is about the trials of law school and is essentially the turning point of the production.
The song 'Chips on My Shoulder' by Soft Cell also references the phrase.