Job's three friends learn something as well. They learn about God's grace and forgiveness through their sin. Earlier in the book they argued that a sinner always gets what he or she deserves. The sinner always gets punishment. In their minds God doesn't ever forgive, he only punishes. They assumed, wrongly, that Job was simply getting what was fair for a sinner of his caliber. They were wrong. By the end we find out that they are actually the wicked men in this story and God's anger now burns against them because they have not spoken what was right about God (Job. 42:7-9). According to their theology they should get a punishment proportional to their folly. But they don't.
God, through the prayer and sacrifice offered by Job, forgives them (Job 42:7-9). How ironic! The man whom they condemned as being far from God is now the one who mediates between them and God. They once spoke of God operating on a simple tit-for-tat scale with sinners but now they don't get what they deserve for their sin. Instead, they experience God's grace and forgiveness.
Everyone learns something valuable at the end. Hopefully you made it all the way through Job with us (reading plan here - check out the 3rd column). What did you learn that was of value?