The concept of loyalty in Beowulf is not just shown in various battles fought by Beowulf. Actually, Beowulf's first act of loyalty predates all the battles the title character fights. Beowulf would have never left his home country in the first place if he had not been compelled to do so on behalf of his father's loyal relationship to Hrothgar. There was a bond of allegiance from many years prior between Hrothgar and Beowulf's father. Even though that bond is not literally Beowulf's, customs of the time dictated that the sons honor allegiances made by their fathers and grandfathers before them. This loyalty that transcended generations provides the original motivation for Beowulf to offer his help to Hrothgar.
Once Hrothgar lets his guard down enough to trust Beowulf, the well-known battles occur. Staying to fight Grendel's mother is definitely a sign of loyalty shown by Beowulf. The debt that Beowulf tries to pay by fighting Grendel is a debt paid in full without the death of Grendel's mother; staying to fight the second fight with Grendel's mother allows Beowulf to show even more of his loyalty to Hrothgar as well as his loyalty to societal ideals.
At the end of the story, Beowulf's loyalty is to those who will protect his homeland once he is gone. In particular, he entrusts Wiglaf with being the new king and makes sure that there will be treasure enough left for those who remain alive after Beowulf's death. (Even though the Geatish warriors are afraid to put themselves in harm's way, Beowulf does not exclude them while he is on his deathbed.) Beowulf leaves a great deal of mortal treasure because he wants his reputation as a loyal king to live on in the hearts of those who have benefited from his previous choices and loyalty.
Beowulf shows loyalty in the story in several ways. First, he shows loyalty to his men by doing his very best to protect them and by fighting Grendel alone. He also shows loyalty to his king when he asks Hrothgar to send his reward to his king if he should die in battle. He shows loyalty to Hrothgar by tracking down Grendel’s mother after she kills Hrothgar’s good friend.
Later in the story, Beowulf the king shows loyalty to his subjects when he decides to seek out and fight the dragon, even though he is clearly a bit old to be doing so. He shows loyalty to his men by telling them to wait outside the dragon’s lair, as he knows sure death awaits. Beowulf shows loyalty to Wiglaf by rewarding him with armor before he dies.
Loyalty is, in fact, a recurring theme in the story, with some characters neglecting to show Beowulf the same loyalty he has shown them. For example, when he is fighting Grendel’s mother, Hrothgar’s men decide he has died and they leave. Beowulf’s men remain, convinced their leader is still alive. During the dragon scene, it is Beowulf’s men who abandon him to the dragon and only Wiglaf who stays behind.