For Moses writes about the righteousness which is of the law, "THE MAN WHO DOES THOSE THINGS SHALL LIVE BY THEM." (Romans 10:5)
Paul knew many of his fellow Israelites rejected God’s righteousness and attempted to establish their own righteousness.
God’s righteousness was available to them, the same as it was for everyone, but obtaining the righteousness of God meant submitting to the gospel of Christ - the Messiah whom the Scriptures pointed to.
“The Man Who Does These Things.”
We’ve talked about this in detail during our study of Romans. A failure to keep the law perfectly meant a person sinned, which brought them under the condemnation of the law (Romans 7:7-11). And the just reward for sin is death (Romans 6:23).
The Law of Moses wasn’t bad - in fact, Paul describes it as “holy and just and good” (Romans 7:12).
So, if you did the Law, you would live by it. The problem was that no one kept it without sinning. Until Jesus.
In reference to the Law of Moses, it was said that righteousness is accomplished by keeping the law. The quote comes from Leviticus 18:5. But the simple fact is no man ever kept the law perfectly except Jesus Christ. Therefore, the only hope that any Israelite had was to be in Christ. - Wacaster, Studies in Romans, 361
However, Paul was not downplaying obeying what God had said. Paul even talked about the “obedience to the faith” in Romans 1:5.
Paul, however, was not against “doing” as he has already argued in 8:1-11. Rather, he quoted Leviticus 18:5 because of its promise of life for those who heeded the Law, a promise fully in harmony with the thrust of Deuteronomy 30:15: “See, I have set before you today life and prosperity, and death and adversity.” - Pollard, Truth for Today Commentary, 358
The Law Pointed to Christ.
When we consider [Romans 10:4], the only conclusion we can draw is that when the faithful Israelite kept the law by faith in God, looking to the promised Messiah, that man’s faith saved him, Christ being the “end of the law unto righteousness.” - Wacaster, Studies in Romans, 361
The bottom line for Paul was that the Law proclaims the gospel by prophetically referring to Christ and provides the interpretative framework by which he read Israel’s Scriptures. Those who live by faith are in fact “doing the law” in the sense intended by Deuteronomy and Leviticus. - Pollard, Truth for Today Commentary, 358
Rejecting Christ meant rejecting what the Old Testament Scriptures pointed to. It meant refusing to live by faith.
Obeying God is essential. But obeying God is not about earning our salvation or the blessings of God, for we can never earn His grace and mercy.
Obeying God is about trusting Him and living by faith (see Hebrews 11 and James 2:14-26).