Far be it from me to say that you are right; till I die I will not put away my integrity from me. I hold fast my righteousness and will not let it go; my heart does not reproach me for any of my days.
As a litany of accusation flies at him nonstop, Job sticks to his guns. In no uncertain terms, he lets his friends know that they will not shame him with false guilt. He will never admit that they are right about the diagnosis of his suffering. Their erroneous theology is abhorrent to him. Job will have absolutely none of it. He would die before he let them guilt him into a confession of a wrong he did not do.
This is not clinging to any sort of self-righteousness. Job has already appealed to God as his vindication. Instead, Job is convinced that he has obeyed God and that God has been pleased with him. If he had any remorse or conviction of sin, it would have been another matter. But Job has the courage of a clean conscience. And it leads him to the strength he has to stand against false accusations from men who were supposed to know him the best of all.
Job's heart is clear for two reasons: 1) He knows that God is not judging him for some evil he has hidden. 2) He trusts that God has a purpose even in this present unthinkable trial. That is the view toward difficulty that keeps him hanging on. He will weather this storm with unshakable conviction and firm faith in God. It is not so much that Job trusts his own integrity... rather, he trusts the God Who declares him right in heaven's eyes.