I would like your help to understand the book of Job. His friends did not speak the truth about God, but did Job? If so, then why does the Lord rebuke him? What about the words of his other friend Elihu?
Job is part of the wisdom section of Scripture, which runs from Job to Ecclesiastes. Each of the books in this section confounds human wisdom by explaining what is "right living" and "wrong living" yet at the same time demonstrating that the quality of one's life does not turn on whether we do right or wrong. Evil men see riches and ruin; good men know disasters and peace. There is no logic to be found in the outcomes of life, and this is God's intention.
Job’s words speak truth in such that he had endeavored his whole life to be righteous before God, but he also understood that his righteousness ultimately came from God by grace alone, as he says:
Job 19:25 “As for me, I know that my Redeemer lives,
And at the last He will take His stand on the earth.
God does not correct Job on what Job says about God, so his observations on God's nature and character are generally correct. On the other hand, Job's view that God should assign rewards on earth according to the way Job assumes should be done was in error, and God addresses that error with Job in Chapter 40:1-4.
Although some consider Elihu offers the best counsel of the friends, his counsel is still poor because of a wrong attitude toward God and bad assumptions about how God works. First, when Elihu comes to Job, he comes with self-righteous anger. We can see that in the text:
Job 32:2 But the anger of Elihu the son of Barachel the Buzite, of the family of Ram burned; against Job his anger burned because he justified himself before God.
Job 32:3 And his anger burned against his three friends because they had found no answer, and yet had condemned Job.
Job 32:4 Now Elihu had waited to speak to Job because they were years older than he.
Job 32:5 And when Elihu saw that there was no answer in the mouth of the three men his anger burned.
Job 32:6 So Elihu the son of Barachel the Buzite spoke out and said,
Job 32:17 “I too will answer my share,
I also will tell my opinion.
Job 33:3 “My words are from the uprightness of my heart,
Furthermore, Elihu approaches Job with pride and arrogance:
Job 33:31 “Pay attention, O Job, listen to me;
Keep silent, and let me speak.
Job 33:32 “Then if you have anything to say, answer me;
Speak, for I desire to justify you.
Job 33:33 “If not, listen to me;
Keep silent, and I will teach you wisdom.”
Also, Elihu depicts God responding to man’s works rather than the other way around:
Job 34:4 “Let us choose for ourselves what is right;
Let us know among ourselves what is good.
Job 34:11 “For He pays a man according to his work,
And makes him find it according to his way.
Elihu pridefully thinks he is worthy to be Job’s judge, while not willing to wait for the Lord’s judgement to be revealed:
Job 34:35 ‘Job speaks without knowledge,
And his words are without wisdom.
Job 34:36 ‘Job ought to be tried to the limit,
Because he answers like wicked men.
But while the Lord does not mention Elihu or his words in the judgement at the end of Job, God's counsel to Job contradicts Elihu's counsel, which tells us God did not approve:
Job 38:1 Then the LORD answered Job out of the whirlwind and said,
Job 38:2 “Who is this that darkens counsel
By words without knowledge?
In the end, the Lord rebukes Job as although he spoke the truth about God, he did not understand the application of God’s righteousness. Job ultimately acknowledges this.
Job 42:1 Then Job answered the LORD and said,
Job 42:2 “I know that You can do all things,
And that no purpose of Yours can be thwarted.
Job 42:3 ‘Who is this that hides counsel without knowledge?’
“Therefore I have declared that which I did not understand,
Things too wonderful for me, which I did not know.”
Job 42:4 ‘Hear, now, and I will speak;
I will ask You, and You instruct me.’
Job 42:5 “I have heard of You by the hearing of the ear;
But now my eye sees You;
Job 42:6 Therefore I retract,
And I repent in dust and ashes.”
Job 42:7 It came about after the LORD had spoken these words to Job, that the LORD said to Eliphaz the Temanite, “My wrath is kindled against you and against your two friends, because you have not spoken of Me what is right as My servant Job has.
Job 42:8 “Now therefore, take for yourselves seven bulls and seven rams, and go to My servant Job, and offer up a burnt offering for yourselves, and My servant Job will pray for you. For I will accept him so that I may not do with you according to your folly, because you have not spoken of Me what is right, as My servant Job has.”
Job 42:9 So Eliphaz the Temanite and Bildad the Shuhite and Zophar the Naamathite went and did as the LORD told them; and the LORD accepted Job.
God ultimately declares that Job spoke right about God, but the friends of Job had not spoken correctly. God told Job to offer sacrifices for them and pray for them before God, and God accepts these from Job.
To summarize, in order to learn from Job we must understand the Lord has a purpose in all He does, but He will not allow us to discern His purposes merely by observing the world and drawing conclusions from the condition of our lives. God will confound our wisdom by doing the unexpected at times (as in the case of Job), so the only way to know God and His ways is to be taught by God through His word. Even then, a true understanding of God awaits our glorified life.