Job answers Yahweh with humility: I know that you can do all things, and that no purpose of yours can be restrained. He admits he had spoken of things too wonderful for him. I had heard of you by the hearing of the ear, but now my eye sees you. Therefore I abhor myself, and repent in dust and ashes. Job is not confessing a hidden sin that caused his suffering; he repents of speaking about God without knowledge.
Then Yahweh speaks to Eliphaz the Temanite. His wrath is kindled against Eliphaz and his two friends, for they have not spoken of Him the thing that is right, as His servant Job has. This is God's verdict on the dialogue. The friends had defended God with false claims, insisting that Job's suffering proved his guilt. Job had said hard things, but he spoke honestly to God. The friends must bring seven bulls and seven rams, and Job will pray for them.
Yahweh restored Job's prosperity when he prayed for his friends. Yahweh gave Job twice as much as he had before. He had also seven sons and three daughters, and in all the land were no women found so beautiful as the daughters of Job. So Job died, being old and full of days. In the New Testament, James writes that you have heard of the perseverance of Job and have seen the Lord in the outcome, and how the Lord is full of compassion and mercy (James 5:11).