Even now, behold, my witness is in heaven, and he who testifies for me is on high. My friends scorn me; my eye pours out tears to God, that he would argue the case of a man with God, as a son of man does with his neighbor.
Job's hope is drawn to trust in the reality that God knows the truth about him. God has been witness to all of Job's life and every action he has ever taken. Job is confident that God can clear him of the accusations brought by his friends. His friends were putting him on trial over his suffering. And their attempts at comfort felt like scorn to him.
It is an insight into Job's character at this point to see him direct his appeal to God. When his friends turned his pain into attacks against him, Job poured out his tears, frustrations, and disappointments to God. He directed his hope to the only person Who would possibly help him now. And the request Job has of God is unusual, but not out of place for an upright man to make.
He knows God is the only true witness to Job's integrity. He also knows that God is the only Judge of the human heart. And so he puts all of his "case" in God's hands: God is the witness to Job's upright actions and can testify on his behalf; God is the Judge Who can clear Job of the accusations his friends have leveled; God is Job's defense attorney, arguing the case so that all may be convinced.
Job has no way to explain his present circumstances except to appeal to God. Job has no way of shutting down the accusing slander of his friends except God's vindication of him. And nobody is left to plead Job's case except God. Job is leaning hard by faith into the the arms of God to withstand his suffering and the sinful judgments of his friends.