I believe it is important to clarify that a person is in fact saved and justified by faith, and not by works of righteousness, as indicated in the following scriptures:
Ephesians 2
8 For it is by grace you have been saved, through faith—and this not from yourselves, it is the gift of God—
9 not by works, so that no one can boast.
Romans 3
28 For we maintain that a man is justified by faith apart from observing the law.
Romans 4
1 What then shall we say that Abraham, our forefather, discovered in this matter?
2 If, in fact, Abraham was justified by works, he had something to boast about—but not before God.
3 What does the Scripture say? "Abraham believed God, and it was credited to him as righteousness."
4 Now when a man works, his wages are not credited to him as a gift, but as an obligation.
5 However, to the man who does not work but trusts God who justifies the wicked, his faith is credited as righteousness.
6 David says the same thing when he speaks of the blessedness of the man to whom God credits righteousness apart from works:
7 "Blessed are they whose transgressions are forgiven, whose sins are covered.
8 Blessed is the man whose sin the Lord will never count against him."
In addition, the following scripture indicates that if someone attempts to achieve justification by works of righteousness (the law), that person will forfeit his salvation:
Galatians 5
4 You who are trying to be justified by law have been alienated from Christ; you have fallen away from grace.
The question then arises, what about the following scripture?
(NIV)
James 2
17 In the same way, faith by itself, if it is not accompanied by action, is dead.
(NASB)
James 2
17 Even so faith, if it has no works, is dead, being by itself.
In spite of the impression many people get from the NIV version of the above scripture, the NASB (also the RSV) versions of the scripture indicate more clearly, that it is not that if someone does not perform works of righteousness along with having faith, then that person's faith is dead: but rather if a person's faith does not produce or cause righteous behavior to be seen in him, then that person's faith is dead.
James 2:17 is harmonious with the following scriptures.
Philippians 3
8 What is more, I consider everything a loss compared to the surpassing greatness of knowing Christ Jesus my Lord, for whose sake I have lost all things. I consider them rubbish, that I may gain Christ
9 and be found in him, not having a righteousness of my own that comes from the law, but that which is through faith in Christ—the righteousness that comes from God and is by faith.
Romans 9
30 What then shall we say? That the Gentiles, who did not pursue righteousness, have obtained it, a righteousness that is by faith;
31 but Israel, who pursued a law of righteousness, has not attained it.
32 Why not? Because they pursued it not by faith but as if it were by works. They stumbled over the "stumbling stone."
33 As it is written: "See, I lay in Zion a stone that causes men to stumble and a rock that makes them fall, and the one who trusts in him will never be put to shame."
The 2 scriptures immediately above, indicate that real faith causes righteous behavior to be seen in a person - even when that person does not (directly) pursue it. Therefore it can be seen from the scriptures immediately above (along with James 2:17), that we are saved by a faith, that causes righteous behavior to be seen in us - even though we do not directly pursue righteousness.
There are those who say that even though we should not directly pursue the law, we should directly pursue righteousness none-the-less, in order to achieve it. However, isn't righteousness outlined in the law (e.g. "... love your neighbor as yourself ..." [Leviticus 19:18])? And if we directly pursue righteousness, we directly pursue the law? Therefore it is impossible to directly pursue righteousness without pursuing the law.
Even if someone was to say that we should achieve righteousness by following Christ's commandments directly, but not the law, we would still run into the problem of directly pursuing the law (if we followed that person's advice), because one of Christ's commandments is that we love each other (John 15:17) - which is outlined in the law (Leviticus 19:18). Further, Christ commanded in Matthew 5:17-20 that we teach others the law, as well as uphold the law. Therefore it is impossible to follow Christ’s commandments by directly pursuing them but not the law, because to do so, we must also directly pursue the law.
It is important to point out that the issue is not whether we should follow or uphold the law: the issue is how we are supposed to go about doing so. We are not to directly follow the law: but rather we are supposed to indirectly follow the law by having faith. The fact that real faith causes someone to achieve righteousness (James 2:17, Philippians 3:9, Romans 9:30), and the fact that only those who obey the law will be declared righteous (Romans 2:13), means that having faith causes someone to obey or act consistently with the law - and this is the only legitimate means by which someone can follow the law. That is what the following scripture (and Galatians 2:15-16) mean:
Romans 3
21 But now a righteousness from God, apart from law, has been made known, to which the Law and the Prophets testify.
22 This righteousness from God comes through faith in Jesus Christ to all who believe. There is no difference,
23 for all have sinned and fall short of the glory of God,
24 and are justified freely by his grace through the redemption that came by Christ Jesus.
The scripture above indicates that the righteousness that is produced by faith, which does not come from directly following the law, is the same righteousness that is outlined in the law, and which the prophets spoke about.
(Please read here, why it is impossible for someone to achieve righteousness by doing good deeds directly / following the law.)
Therefore a person can really only achieve righteousness by faith, and should never attempt to do so directly.