What is the function of Eumaeus the swineherd in Homer's Odyssey?
I like this question a lot. Eumaeus probably doesn't get as much attention as he deserves, even though he is one of the most frequently mentioned characters in Odyssey 13-24 and the person with whom Odysseus stays during one-sixth of the Odyssey (Books 13-16).
Eumaeus is the first Ithacan that Odysseus encounters upon returning to his native land. He was a humble herder of pigs, but a man whom the disguised Odysseus discovers was loyal to his master (Odysseus).
Because hospitality (xenia) is one of the main focal points of this epic poem, Eumaeus proves himself to be the epitome of a good host. Even though Eumaeus lives in a simple hut, he offers his guest (Odysseus) everything that he possibly can, in spite of his lowly status.
he...made a bed for Odysseus nearer the fire, throwing sheep and goatskins over it. Then Odysseus lay down again, and the swineherd covered him with a big thick blanket...There Odysseus could sleep... But the swineherd was averse to staying there away from his hogs, and prepared to go outside. Odysseus was delighted to see him take such care of his master’s herd in his absence.
After Odysseus departs from Eumaeus' hut and returns to the palace, Eumaeus later fights alongside Odysseus against the suitors.
Thus, Eumaeus is the epitome of the loyal servant and also a model for good hospitality in the Odyssey.