For all who have sinned without the Law will also perish without the Law, and all who have sinned under the Law will be judged by the Law; Romans 2:12
Now we know that whatever the law says, it says to those who are under the law, so that every mouth may be silenced and the whole world held accountable to God. Romans 3:19
Looking at these verses we must consider what the law is.
Yes!
The law was given as an example of the perfection necessary to stand justified before a Holy God.
What makes you think that?
We also must remember that God knew man couldn't keep it. It wasn't given for men to keep but to reveal their sinfulness. Having the standard in front of them, they could see ,if they were honest, that they didn't measure up.
That is only part of it! And if that is all people see it is no wonder they don't want anything to do with it. It is a shame people are not taught by the preachers what the whole truth is, but they very likely don't know either (and that raises the question of their fitness for duty as a preacher, but that is for another time). On the other hand we are told to study and search the scriptures so it is not just preachers and teachers to blame.
...will failThe only hope was to have faith in the sacrifice for their sin, which would eventually lead them to the perfect sacrifice of Jesus.
The standards of God haven't changed, so yes, anyone trying to get to God by their own efforts
must still meet those impossible standards. Sadly they will never live up to the perfection necessary without entering through the door, which is Christ.