Read Genesis 15-17, then Read Galatians 3-4, then read Romans 3-4.
You will find that Abraham was the first man to be made righteous by his faith in Jesus Christ in Genesis 15. The Bible confirms this in Gal 3.
Gen 15:5 And he brought him forth abroad, and said, Look now toward heaven, and tell the stars, if thou be able to number them: and he said unto him, So shall thy seed be.
6 And he believed in the LORD; and he counted it to him for righteousness.
Gal 3:5 So then, does He who provides you with the Spirit and works miracles among you, do it by the works of the Law, or by hearing with faith?
6 Even so Abraham BELIEVED GOD, AND IT WAS RECKONED TO HIM AS RIGHTEOUSNESS.
7 Therefore, be sure that it is those who are of faith who are sons of Abraham.
8 The Scripture, foreseeing that God would justify the Gentiles by faith, preached the gospel beforehand to Abraham, saying, "ALL THE NATIONS WILL BE BLESSED IN YOU."
9 So then those who are of faith are blessed with Abraham, the believer.
This scripture LITERALLY says that God preached the Gospel of Jesus Christ to Abraham, and when Abraham believed the Gospel of Jesus Christ, he was saved (made righteous) by his faith. How do we know God was talking about Jesus Christ?
Gal 3:16 Now the promises were spoken to Abraham and to his seed. He does not say, "And to seeds," as referring to many, but rather to one, "And to your seed," that is, Christ.
Furthermore, we have to understand that God made Abraham righteous through grace by faith 430 years before the Law of Moses and the 10 commandments were given. So this begs the question - if Abraham was made righteous before the law existed, and Abraham is the faith of those who believe, then what Law is necessary for salvation?
Gal 3:17 What I am saying is this: the Law, which came four hundred and thirty years later, does not invalidate a covenant previously ratified by God, so as to nullify the promise.
Paul makes the point that The Law cannot invalidate the covenant God made with Abraham. The Law cannot disannul the promise. We always think about it the other way around... but truly, righteousness by faith existed outside of and apart from the law for 430 years, and the Law doesn't change that promise.
Rom 3:28 For we maintain that a man is justified by faith apart from works of the Law.
Rom 4:9 Is this blessing then on the circumcised, or on the uncircumcised also? For we say, "FAITH WAS CREDITED TO ABRAHAM AS RIGHTEOUSNESS."
10 How then was it credited? While he was circumcised, or uncircumcised? Not while circumcised, but while uncircumcised;
So what was the purpose of The Law? To teach us that we need salvation... to show us that N
NE could attain salvation by Works of The Law, and that the ONLY way was by faith in the Gospel of Jesus Christ - the same faith that Abraham first had.
Gal 3:19 Why the Law then? It was added because of transgressions, having been ordained through angels by the agency of a mediator, until the seed would come to whom the promise had been made.
22 But the Scripture has shut up everyone under sin, so that the promise by faith in Jesus Christ might be given to those who believe.
23 But before faith came, we were kept in custody under the law, being shut up to the faith which was later to be revealed.
24 Therefore the Law has become our tutor to lead us to Christ, so that we may be justified by faith.
25 But now that faith has come, we are no longer under a tutor.
26 For you are all sons of God through faith in Christ Jesus.