The mystery of being saved by faith and justified by works is resolved by knowing the difference between being born to do good works, and becoming natural at doing good works, to become born again.
I do not frustrate the grace of God: for if righteousness come by the law, then Christ is dead in vain.
The answer is how and where does God's righteousness come to man, that he may be justified by Christ.
In Scripture, God's righteousness comes by the faith of Jesus, and it comes into the heart first by birth of the Spirit: we are born again unto good works, not born again by doing good works, until it becomes natural to do so.
We do not 'discover' we are born again, when we learn we are doing good things naturally: we know we are born again by faith, and understand we have His power to do good at all times:
And we know that we are of God, and the whole world lieth in wickedness.
And we know that the Son of God is come, and hath given us an understanding, that we may know him that is true, and we are in him that is true, even in his Son Jesus Christ. This is the true God, and eternal life.
We don't seek to change our wicked ways by force of will, until we begin to do so naturally, so as to become as newborn creatures.
We become born again and sons of God by believing Jesus, knowing that the whole world lies in wickedness, and we are no more of that world, having no more fellowship with it.
With natural man, faith does not change the works, but only works can change the faith.
The reformation of Jesus Christ on earth is to undo the natural man's carnal understanding that to change ourselves, we must first change our works.
To the natural mind, all change is made by power of will, not by faith. The natural man's faith is in himself, and that faith of himself only transforms, as he sees himself changing by his works: We become better, because we do better, and we become as newborn, only when we become natural at doing better.
Any man, by power of will, can change his works in life, so that it becomes natural to do so: he is not born to do them, but willfully changes them, until it becomes so natural to him as it were by birth.
This is the error of them that were Jews by nature, who sought the righteousness of God to come to themselves, by doing righteousness as it were by law, and not by faith.
Wherefore? Because they sought it not by faith, but as it were by the works of the law.
Neither the law nor the works of the law are the enemies of salvation by new birth, even as the letter of the law is not dead, except it be without the Spirit: being done not by faith but by will.
But as many as received him, to them gave he power to become the sons of God, even to them that believe on his name: Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God.
The doctrine of Christ against being saved by works, is not against works of the law, but is only against becoming new born by will of man to keep the law, until it becomes natural to do so, as by nature, not by birth.
Even as the first and second great commandments, God is a God of first things first: first be born again by the faith of Jesus to love Him with all the heart, second to love our neighbors as ourselves from the heart.
Thou blind Pharisee, cleanse first that which is within the cup and platter, that the outside of them may be clean also.
Thou hypocrite, first cast out the beam out of thine own eye; and then shalt thou see clearly to cast out the mote out of thy brother's eye.