That's it niminy. Satan is trying to show that people's 'goodness' is only good as long as they are blessed/well off/happy or whatever, and is 'challenging' God to show that Job will fall down - Job being the best example of 'good' that can be shown in a human being at the time. God, for whatever reason, needs to take this challenge - as much for the sake of Job as to score any celestial points. It's very hard to get our head round - it can seem arbitrary, unfair even. But read as a cautionary tale, maybe not so much?
The OT view was that people were rewarded and blessed according to what they have done, how righteous they are. The wicked are punished by bad fortune, the good rewarded with blessing and prosperity. This book completely turns this idea on its head - this is the most righteous man, after all, and should surely prove the whole 'prosperity comes to those who do good' concept - but here's Job, stripped of absolutely everything, broken and bleeding. His friends try to blame him, say he must be at fault - but I'm skipping ahead, let's wait until we come to those parts!
Job saying 'blessed be the name of the Lord' in this context has always struck me, again and again. Wow - if anyone had the right to rant, rail and accuse God, it was him. But he praised God anyway. And it's my experience that when we praise God anyway we somehow find ourselves in a different place, a place of hope and peace, in the midst of the chaos and brokenness. It's hard to praise God in these times, impossible sometimes, and it's not the sort of praise which is all happy, but more of a sacrificial whisper to God 'bless your name anyway. I am so broken, but I praise you.' Saying it has an amazing power - we don't even have to 'feel' it.
It always reminds me of this song: