Summary: God demands an answer from Job; Job takes it back; God makes his friends give Job some of their stuff and makes Job rich again, even gives him new kids.
Let's look at the end of Job from three perspectives. Theological, Bible as Science, and Social Justice.
Theological: The message of Job is intensely maddening. It is really frustrating that Job doesn't make his case, but crumbles before God. "Surely I spoke of things I did not understand." Job 42:3. Really? Not according to the story's narrator. According to the narrator, God let Satan attack you for no reason. And, getting all of your stuff back at the end does not make up for the, I don't know, CHILDREN, that were lost. [By the way, I thought it was obvious that the epilogue is added later, but review of my dad's old text books anyway, puts that at "some people thing," so who knows?]
Bible as Science: We've got some real problems here. Besides the whole Sons of God being translated as angels, Job lives 140 years after his calamities. Job 42:16. Recall that earlier we read that the "sons of God saw that the daughters of humans were beautiful," and started marrying them; so, God put a stop to that and declared "My Spirit will not contend with humans forever, for they are mortal; their days will be a hundred and twenty years." Gen. 6:2-3. Oops. This doesn't bother me, because I think it is dumb to try to use the Bible as a science book, but Job posses some problems for these folks.
Social Justice: Now, this is interesting. Job lists caring for the poor as a reason why he's a good guy. And when he gets everything back, his new daughters get both names and an inheritance. Not to mention, animals and creation get pretty special treatment here. Interesting.
UPDATE: If you would like to hear a podcast with me and my pastor on Job, it's available here.