Job points to Christ.
I was at a non-denominational Bible Study last night; we were looking at the book of Job, chapters 32-37 (the speech of Elihu). Eventually we got around to asking why Job wasn't able to endure his suffering without finally lashing out against God (although not cursing Him, as Satan had hoped) at the instigation of his three "friends". I pointed out that, whenever Job lived (we don't know) and to whatever people he belonged (we don't know for sure, maybe he was an Aramean), the world was without the totality of the revelation of God in Jesus Christ.
Suffering was seen simply as a punishment for wrong-doing (which Job had none of when he received his punishment), and there was nothing redemptive or holy about it. It couldn't glorify God. You could accept it, sure, but you couldn't see the good of it. Christ changed that for us. The epistles mention the redemptive value of suffering plenty! Even Jesus, in John's Gospel, asks the Father to "glorify" him, referring to his being "lifted up" on the cross. The crucifixion was the first stage of the glorification of Jesus Christ! Suffering on the cross was glory to God!
Job did not have this knowledge. I wouldn't say that God made "an example" of him, but I do believe the book of Job is there to point us, in the Old Testament, to the incompletion of the earlier covenants, and of the necessity for Jesus Christ who redeems us in his suffering and in our suffering. In Christ we can "offer up" our suffering as a sacrifice united to the body of Jesus on the cross; in Christ we can glorify God in our affliction. Revelation 3:19 tells us that the Lord God chastises and reproves those He loves. Let us bear our suffering nobly and humbly, glorifying God. Let Job serve as the example of who we were, and Jesus as the example of who we must become.