Elihu says "I am in place of God" and you think Job was the self-righteous one? nah
I have read commentators who think that God's first words when he shows up are directed to Elihu. "who is this that darkens my counsel speaking words without knowledge" I don't fall into that camp, but if Elihu had the slightest bit of humility to him he should have at least been worried about that.
And yeah, there is a lot of scripture between the beginning and the end but we can't get to discussing it without a common frame of reference. I prefer to start with the assumption that what God said is right and God said Job was right. If you say the friends were right then you go down a dark path. the friends falsely accused Job and grow increasingly angry and abusive toward a grieving man motivated by their own envy and self righteousness.