The thought Job would confront God with the injustice of his suffering begins to outweigh his longing for the peace of death. Although he never completely gives up that thought, but returns to it at the end of each speech, other ideas begin to dominate. He refocuses his attention, for example, on how angry he is with God.
A second factor gives Job hope–the support he receives from his friends. His monologue in chapter three as well as his dialogues take place in the presence of three fellow wisdom teachers. Although technically peers, he may well be the elder. Because of their refusal to listen to his pleas of innocence, this positive aspect of the friends may surprise us. At the same time they reject his requests for verbal support, they maintain their social support. In spite of his obstinacy, they let him speak until the end.
In spite of all the disagreement, his friends stick with Job long enough for him to work out a lot of his issues. They also keep him focused on God. When they give up, he turns to reflection (chapter 28), to listening to someone else (32-37) and to hearing God speak (38-42). Their presence, I believe, enables Job to take those steps.
To provide others hope, God uses our support of one another more than we realize.