" . . . But how can a man be righteous before God?"
Job asks *the*most profound question here. How, indeed, *can* a human being be *righteous* before God? If a righteous standing before God was based on works, then we would have to be absolutely perfect, never sinning, and doing everything right all the time.
But our right standing is not based on our works, or the law (even of God). Instead, it if found in Christ alone, who perfectly *did* keep the law without blemish. His righteousness is *imputed* to the elect churchman, by grace through faith. Therefore, it *is* possible to be--even today--perfectly righteous before a completely holy God--but there is only one way: by grace through faith in Christ (alone).
[Puritan quote of the day: "For we live by grace, and we must die by grace and stand at the day of judgment by grace--not in our own righteousness, but in the righteousness of Christ, being found in Him." --Richard Sibbes, in "Glorious Freedom"]