It sits uneasily beside the Deuteronomist's simple moral calculus: those who serve God prosper; the wicked are punished.
Job reminds us that good is not always rewarded. Righteous people also suffer. The Prosperity Gospel is a lie.
Job asks us "What is the value of righteousness? Why be good? Why worship God if not for the promise of reward?"
The character of Elihu, seemingly added at a late stage in the book's development, may have been intended to offer a new, better perspective on Job's dilemma. He doesn't really solve the problem of theodicy but serves more as a bridge between the assertion of divine justice made by Eliphaz and Co. and YHWH's bald assertion of sovereignty. If Elihu adds any new element to the discussion it is Job 35:4-8 where he says that God is not harmed by human sin but one's neighbors are. This may be the most compelling reason offered for righteous behavior. It is not to benefit God or myself but my neighbor.
An old theology prof of mine used to say "The primary symbol of God, for the Christian, is the neighbor."
In the end, the value of The book of Job is not that it gives pat answers but that it makes us think. The Bible is used so often as a conversation-stopping authority, a book of final, unassailable answers. The presence of Job in the canon refutes all such uses.