In this chapter the apostle Paul is, of course, speaking to the Jews again. And the purpose of this chapter is to answer questions and objections that some Jews had in regards to their position or status as Jews, and to point out further the relationship of the law to faith.
Paul reassured the Jews that their Jewishness was of value, because it was to the Jews that God revealed Himself. They were given the law, which was God revealing to man His requirements for righteousness. He entrusted them with this most sacred knowledge.
But having knowledge of the law is not, of course, enough. There must be belief. Without belief, judgement follows. And this is where Jew and Gentile become alike. As Paul said, “There is no one righteous, not even one…”. No one gains righteousness by the law, because the law reveals what sin is, and all have sinned.
So are we without hope? No! Verse 24 says, “But they are justified freely by his grace through the redemption that is in Christ Jesus.” Because of what Jesus did, we are declared clean before God. And verses 27 and 28 continue the thought, “Where, then, is boasting? It is excluded! By what principle? Of works? No, but by the principle of faith! For we consider that a person is declared righteous by faith *apart* from the works of the law.”
The law cannot save us, it can only condemn us. That is what makes the law valuable. The only way to be right before God is through belief in Jesus Christ.