You should probably try reading the book again a few times. Elihu said that Job justified himself instead of justifying God, this is true and is what self righteousness is. Elihu was not one of Job's 3 friends, but someone who isn't mentioned at all, until he speaks. Elihu is never corrected or rebuked in the book of Job. If Job did indeed write the book of Job, then Job did indeed confess his own sin of self righteousness, of justifying himself instead of justifying God.
Lets really get down to business. Are you justified? That is, have you been accounted as righteous before God? Was it for anything that you've ever done in your lifetime, and if not, why or how are you justified?