Pachycephalosauria

The Pachycephalosaurs are a group of ornithopod dinosaurs in the suborder Cerapoda. Their thick round skulls were used for defence and, probably, for mating contests. They were bipedal herbivores.
In some species, the skull roof is domed and several inches thick; in others it is flat or wedge-shaped.The flat-headed pachycephalosaurs are usually regarded as distinct species or even families, but they may be juveniles of dome-headed adults. The domes were often surrounded by nodes and/or spikes.
There is evidence of head-butting in pachycephalosaurs. Of 100 domes studied, 20 percent showed signs of healed injuries. The pathologies included pitting where the bone had become infected from wounds that originated in the skin. These findings suggest that pachycephalosaurids may have been using their heads for both display and defence as many modern animals do.
Competition for mates is the usual reason why adult males fight. Competition for territory is another possibility. There are many examples of both in mammalian fighting. And the head could be used as defence against predators.
Incidentally, these thick head shields are called the "parietosquamosal shelf".