Hi Sashenka,
I really appreciate this comment, and I agree with you. I got the idea of God showing off to the devil from Robert Frost's "A Masque of Reason," but this was also an Old Testament God before the coming of Christ. That meant that God had to punish the people that turned away from God and who sinned, but here, in Job, why does an innocent and righteous man suffer so much? That's the central question here.
I believe Job is a type of Jesus, and perhaps the most important precursor to Jesus. A lot of other Old Testament "types" of Jesus, like David (a rapist), Moses (a murderer), and Jonah (a racist) were incredibly flawed people who were unlikely candidates for God's chosen, and yet Job was a type who was righteous and hadn't sinned.
Yet Job is put to the test -- and there are a lot of ways Jesus is a lot like Job. Jesus, too, was an innocent man who suffered. He had his friends deny and betray Him, much like Job. But Jesus went a step further and took on the suffering and sin of humanity when he went on the cross. That's the difference between the God of the Old Testament and the God of the New Testament. It's the same God, but the Trinity was not yet complete in the Son.
I hope that makes sense from my perspective, that God had to be much more of a disciplinarian and do the work of disciplining those who had fallen away, who had turned their backs on Him before the coming of Jesus. God loved us, but God hated our sin. Once Jesus came and finished the work, the world changed, but Job's world was one before Jesus, and a parable to the people who doubted God because they suffer.