I was watching The Boy in Striped Pyjamas, and I saw this skull and crossbones on this Nazi's cap.
Why is it there? (That is, what does this represent?)
The skull and crossbones or "death's head" is not a purely German - still less a specifically Nazi - symbol, but has been, and still is, used by many military units, including the British, Australian and Swedish armies and the US Marine Corps. The British Queen's Royal Lancers use the skull and crossbones with the caption beneath "Or Glory" - the "Death or Glory boys", and 100 Squadron RAF fly it on their flag. It would appear to be a sign of commitment to die fighting, rather than mere "baddassery".
See: Totenkopf (Wikipedia).
The deaths head (Totenkopf) is a symbol that had been in use by many German and Prussian military units in history, going back hundreds of years. It was mainly to signify their high levels of badassery. The SS picked up on this and used it themselves to co-opt that history to mold themselves as an elite force.
Use of the symbol as a military insignia began with the cavalry of the Prussian army under Frederick the Great. Frederick formed Husaren-Regiment Nr. 5 (von Ruesch), a Hussar regiment commanded by Colonel von Ruesch. These Hussars adopted a black uniform with a Totenkopf emblazoned on the front of their mirlitons and wore it on the field in the War of Austrian Succession and in the Seven Years' War.
In 1808, when the regiment was reformed into Leib-Husaren Regiments Nr.1 and Nr.2, the Totenkopf remained a part of the uniform. During the Napoleonic Wars, when Frederick William, Duke of Brunswick-Wolfenbüttel, was killed in battle, his troops changed the colour of their uniforms to black or apple green, with a Totenkopf on their shakos in mourning their dead leader. Other sources claim that the "Black Brunswickers" were so equipped while Friedrich Wilhelm of Brunswick lived, as a sign of revenge on the French.1
The skull continued to be used throughout the Prussian and Brunswick Armed forces until 1918, and some of the stormtroopers that led the last German offensives on the Western Front in 1918 used skull badges.
As others have said the symbol is very, very old. The meaning is both "loyalty unto death" and about remembering your own mortality, not "badassery" or anything else. An excellent reference on the subject is "Death's Head" by Joost Holscher.
As a symbol for soldiers it pre-dates even that by pirates actually. As others have stated it was used by almost all European armed forces. The history of its use for the Germans begins with the Purussian hussars in the 18th Century and the Brunswick forces who went to fight for the British in the Napoleonic wars. It stayed as a famous and respected symbol for the Prussian Lieb hussars into the early 20th century and then was absorbed into the German army. The Nazis tried to co-opt it in the 1930s in order to cash in on its extensive history with the German army. The army protested this however so the Nazi version had to be altered with the addition of a rather goofy oversized jaw to placate them. The totenkopf used by the SS is different from that used by the German army in WW2.
It's also largely an exaggeration (approaching a myth) that Hugo Boss had much of an influence on the look of Nazi uniforms: those uniforms were based on a universal style used by almost all armies since before WW 1, from Australia to the USA, to Japan etc. The style originated in Britain in the late 19th century. Actually it was already present in Prussia at the time of Frederic the Great, whose inspiration for this emblem might have come from some Pandurs units. Two Prussian hussars regiments used this symbol at this time :the 5th and 8th, the later even shown a complete skeleton on its shako. And a "Death hussars" unit also existed during the french revolution, between September 1792 and April 1793.They were dressed in black with the skull and crossbones on the top of their jacket sleeves and on the sabretache.
I don't think SS uniform skull is in any way related to similar insignia in other nations, as suggested by @TheHonRose. I believe it was introduced by Hugo Boss circa 1933 when he designed Nazi uniforms, and the meaning of it was something like "Loyal until death". I don't recall the reference though; you may want to look into early history of Hugo Boss fashion house.
Now, as to where Hugo Boss got the idea of putting a skull on SS uniforms - that I don't know; Oldcat's conjecture about Totenkopf sounds very plausible.
Seven answers and nobody has gone back further than the 18th century?
From at least the 12th century, it has been used for military flags or insignia and as a warning of the ferocity of the unit displaying it. It became associated with piracy from the 14th century onwards, possibly even earlier. By the 15th century, the symbol had developed into its familiar form.
The Knights Templar organisation, active from the 12th until their demise in 1307, adopted a skull-and-crossbones flag to identify ships belonging to their vast fleet. The later Knights of Malta, made up of many former Templars and using the same flag, became known for piracy. The skull and crossbones as a pirate's flag could well predate the Knights Templar
The purpose of the death's head is to function as a memento mori ("remember, you will die").
If a soldier always keeps in front of him the reminder of the inevitability of death, he will fight bravely in battle, because it is better to die in battle, than in bed as a decrepit old man.
It is quite well documented what I wrote above. There have been death's head units in Germany going back to the time of Frederick the Great. Two of the well-known units were the Black Hussars and the Brunswickers. The Brunswickers at one time actually had the words "Momento Mori" written on the badge itself. In other words, the skull and bones had the words "Momento Mori written right under it on their uniform. Here is a 19th-century comment on the badge from a Scottish magazine:
The Skull and Cross bones Has been used for hundreds of years by many country's army's, it symbolises Honor unto death in the protection of the homeland it is not about race The USA & Russia Britain Still use the Skull and Cross bones Today in many of their units
The Skull and Cross bones represents a member of the SS. The Da in the movie was a concentration camp Kommandant, he commanded the camp which would more than likely make him a member of the SS.