Job replies, "I know you can do everything, that nothing is impossible for you. Hear me now."
What Job wishes for the Lord to hear is "I thought I knew you, but I lacked knowledge. Now that I see you clearly, I recant and repent."
Allen & Williamson in Preaching the Old Testament remind us that Job 42:6 is difficult to interpret:
Some scholars think that Job recognizes that both the Deuteronomic viewpoint on blessing and curse (represented in the book of Job by the friends) and Job's persistent demands to understand this notion in another framework of meaning comes up short. Having been addressed directly by the awesome God, Job recognizes that chaos is innately a part of creation and neither chaos nor prosperity can be neatly explained. While chaos is powerful, God's speeches in chapters 38 through 41 assure Job that it will not destroy the patterns of life through which God supports the world.
After this comment by Job, the Lord will say to Eliphaz "I'm angry with you and your friends who have not spoken the truth about me as did Job."
The test is over. Job is returned to his life as it had been.
When Job emerges from his tragedy, he able to pray for his friends--I presume this means the ones who had been badgering him and trying to correct him throughout the book.
He died old--at 140, twice the length of what was expected in Psalm 90:10.
Many commentators think that this section was added by a different source from most of the book of Job. These verses seem to be a reaffirmation of the Deuteronomic theory of blessings as rewards for right behavior in contrast to verses 1-6 in this chapter.
Modern commentators try to reconcile both understandings by saying that whichever we hold, that God is present in our bad times and our good. We may make bad choices or bad things may happen despite our good ones, but God is still with us. And, our recognition of God's presence can help us through our difficult times.