Someone needs to write a monograph, at least an article, about justification in Job. Perhaps someone already has. Job would shed some important light on the subject.
The term “justify” is used a number of times in the book. Elihu joins the fray because he’s angry that Job “justified himself before God” (32:2). Elihu hears ll of Job’s self-defense is a self-justification, and not only a self-justification before the three friends but in Yahweh’s court. Elihu somehow intends his speech to be a justification of Job (33:32). When Yahweh appears, He says that Job has annulled His judgment, and condemned the Lord in order to justify Himself (40:8). That raises the Pauline question of whether Yahweh can show Himself both just and the justifier.
More broadly, the situation of the book raises the question of justification. Job suffers loss after loss. His friends assume he must have deserved it, but Job defends himself. He claims innocence, and longs to appear before Yahweh so he can present his case. He wants a court date, and eventually gets one.
Job 40:8 implies that Job treated justice as a zero-sum game: If Job is innocent, God must be culpable, must have done him wrong. Job thinks he has to condemn God to justify himself, and that annuls God’s judgment.
On the other hand, Yahweh claims that Job spoke right concerning Yahweh, unlike his friends (42:7), and that implies that Job is justified in the divine court: Yahweh lifts up Job’s face (42:9).
If we emphasize the first, we read Job’s words and self-defense as a sinful attempt at self-justification: He condemns God so that he can be in the right. It’s a Barthian conflict of judges – divine and human. If we emphasize the second, Job is an exemplar of justification by faith: Though every bit of evidence suggests that God is against Job, Job insists that God is for him, and Job’s claims are eventually vindicated. Justification by faith takes the form of a hope for future justification; and in the present justification by faith takes the form of relentless self-defense. On this perspective, Job’s insistence on his innocence is not self-righteousness but trust that he will eventually be judged favorably by God.
The resolution is ambiguous, which is why that monograph or article would come in handy.