And it was so, that after the LORD had spoken these words unto Job, the LORD said to Eliphaz the Temanite, My wrath is kindled against thee, and against thy two friends: for ye have not spoken of me the thing that is right, as my servant Job hath. (King James Version)
Job's having "spoken of me what is right" (NRSV) is central to most all readings of the book. (Except where, as in the Septuagint and in Saadiah's commentary, it is rendered "spoken rightly of my servant Job"!) It generates a few problems - didn't God just reprove Job in 38:2?
"Who is this that darkeneth counsel by words without knowledge?"
(Accordingly some, like Gregory the Great and Aquinas, decided on the basis of 42:7 that 38:2 must have been addressed to Elihu.) But God's public praise of Job does cohere with the restitution of Job's goods which follows. Surely it's part of the restitution, and decisive for distinguishing the prosperity of the prologue from that of the epilogue.
And yet. As Terrence Tilley points out, the words of 42:7 are directed to Eliphaz, not to Job! "God never lets Job know he spoke rightly." (Terrence W. Tilley, The Evils of Theodicy [Washington, DC: Georgetown UP, 1991], 91)