Hebrews 11:7 By faith Noah, being warned of God of things not seen as yet, moved with fear, prepared an ark to the saving of his house; by the which he condemned the world, and became heir of the righteousness which is by faith.
Hebrews 11:4 By faith Abel offered unto God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaketh.
True faith produces good works, but the fruit of salvation-works-is never to be confused with the root of salvation-grace. It wasn't the "works" (fruit) that made Noah and Abel righteous, it was their FAITH which produced those good works (fruit). It is never an admixture of faith and works which saves us...salvation has always been by grace alone, through faith alone, in Christ alone - even for the OT saints....based on their understanding of the atonement, shedding of blood, and the promise of a coming Redeemer, the Seed of the woman, Jesus Christ - Genesis 3:15.
Romans 11:6 And if by grace, then is it no more of works: otherwise grace is no more grace. But if it be of works, then is it no more grace: otherwise work is no more work.
The purpose of the Mosaic Law was to reveal sin and show man that he is a guilty sinner before God....it was never given as a means of salvation, because nobody could keep it in the OT and nobody will ever be able to keep it. That's how marvelous God's grace is!
In 1 Timothy 1:5-11 the purpose of the law is made plain:
1 Timothy 1:5 Now the end of the commandment is charity out of a pure heart, and of a good conscience, and of faith unfeigned:
1 Timothy 1:6 From which some having swerved have turned aside unto vain jangling;
1 Timothy 1:7 Desiring to be teachers of the law; understanding neither what they say, nor whereof they affirm.
1 Timothy 1:8 But we know that the law is good, if a man use it lawfully;
1 Timothy 1:9 Knowing this, that the law is not made for a righteous man, but for the lawless and disobedient, for the ungodly and for sinners, for unholy and profane, for murderers of fathers and murderers of mothers, for manslayers,
1 Timothy 1:10 For whoremongers, for them that defile themselves with mankind, for menstealers, for liars, for perjured persons, and if there be any other thing that is contrary to sound doctrine;
1 Timothy 1:11 According to the glorious gospel of the blessed God, which was committed to my trust.
John 6:28 Then said they unto him, What shall we do, that we might work the works of God?
John 6:29 Jesus answered and said unto them, This is the work of God, that ye believe on him whom he hath sent.