In Nordic mythology, the apple is a symbol of immortality. Idun, the goddess of youth and beauty, is the protector of the Golden Apples, the source of immortality for all the gods.
When King Hrothgar sees Beowulf eating the apples without any fear, he is amazed. Unferth warns Beowulf that the grove where the apples grow comes from cursed apple trees.
"An old witch spat her teeth out there," he muttered. "They were bad teeth, green and red and rotting. They grew into apple trees. Nobody in their right mind would eat fruit like that."
Although scholars disagree about the true views of Anglo-Saxons regarding immortality, they can agree that these Germanic tribes believed similarly to the Norse. Norsemen believed that immortality was something they could earn through fame and glory, especially in battle. A true warrior who achieved great acts of valor would then earn immortality in Valhalla, where he would be able to feast and drink to this heart's content every day.
So, the fact that Beowulf ate the apples without fear foreshadows his later great immortal act as a warrior, when he is mortally wounded in his killing of the dragon.