When Rama is exiled, the Ramayana gives two people the chance to refuse and neither does. Sita insists on going because a wife belongs with her husband. Lakshmana simply goes, and the epic does not record anyone inviting him. He leaves his wife Urmila behind in the palace for fourteen years, a detail later retellings have made a great deal of and the Sanskrit text passes over quickly.
His function in the forest is service. He builds the shelters, gathers the food, keeps watch at night, and by later tradition does not sleep at all for the whole period, his share of sleep having been taken on by Urmila. The text presents this as devotion rather than subordination: he is a prince who has chosen to be a servant, and the choosing is the point.
He is also the brother with a temper, and the epic uses him for it. When Bharata comes to the forest with an army to beg Rama to return, it is Lakshmana who assumes an attack and has to be calmed. When Rama accepts the exile without complaint, it is Lakshmana who says the order was unjust and that they should fight. He voices what an ordinary person would feel, so that Rama can decline it, and the pairing is one of the things that keeps a story about a perfect man readable.