As I was reading Job truly to figure out what Job was being rebuked for, I was paying rather close attention to what the Lord said, so that I could determine whether my prior guesses were correct.
But the rebuke doesn't like a typical rebuke. Outside of maybe Job 40:2, the Lord says absolutely nothing of what Job's sins are, and what Job has done that has engendered this rebuke. Instead God spent His time explaining His transcendent power and majesty.
Naturally, this rebukes produces very much of the desired effect (how could God fail in His efforts?). In Job 42:5-6, Job responds,
"I have heard of thee by the hearing of the ear: but now mine eye seeth thee. Wherefore I abhor myself, and repent in dust and ashes."
And there you have it - repentance comes as the result of the Lord's rebuke. Repentance comes because of a further knowledge of who God is. I don't believe it is too much of a stretch to say that ultimately all true repentance will come from a greater knowledge of who God is.
Perhaps if we want to live a life of godliness, we ought to start by gaining a greater knowledge of who God is. And we also ought to continue by gaining a greater knowledge of who God is, and you know what? We ought to end by gaining a greater knowledge of who God is.