The Catholic Church teaches that we are saved by faith and works and that we must still keep the Ten Commandments:
2068 The Council of Trent teaches that the Ten Commandments are obligatory for Christians and that the justified man is still bound to keep them; the Second Vatican Council confirms: "The bishops, successors of the apostles, receive from the Lord . . . the mission of teaching all peoples, and of preaching the Gospel to every creature, so that all men may attain salvation through faith, Baptism and the observance of the Commandments."
But Protestants object!
They say that Scripture says that no one can keep the Commandments. They point to verses such as this:
James 2:8 However, if you fulfill the royal law according to the scripture, “You shall love your neighbor as yourself,” you are doing well. 9 But if you show partiality, you commit sin, and are convicted by the law as transgressors. 10 For whoever keeps the whole law, but falls short in one particular, has become guilty in respect to all of it. 11 For he who said, “You shall not commit adultery,” also said, “You shall not kill.” Even if you do not commit adultery but kill, you have become a transgressor of the law.
And they draw the conclusion that it is somehow wrong to keep the Commandments. Unfortunately for them, just a few verses down, St. James goes on to say:
James 2:17 So also faith of itself, if it does not have works, is dead.
So, he’s obviously not recommending that we should not keep the Law. In fact, he’s saying the exact opposite. He’s admonishing us not to sin. Therefore, he’s saying that if we commit one type of sin, we may as well have committed them all, because the result will be the same, we will fall from grace.
But he does not say that we are incapable of keeping the Law.
Quite the contrary. He seems convinced that we can keep the Law perfectly, if we put our mind to it.
An unspoken assumption
He doesn’t mention it in this chapter. But there is an unspoken assumption underlying his entire treatise. The forgiveness of sins. We find this at the end of the Epistle:
James 5:15 And the prayer of faith shall save the sick, and the Lord shall raise him up; and if he have committed sins, they shall be forgiven him. 16 Confess your faults one to another, and pray one for another, that ye may be healed. The effectual fervent prayer of a righteous man availeth much. 17 Elias was a man subject to like passions as we are, and he prayed earnestly that it might not rain: and it rained not on the earth by the space of three years and six months. 18 And he prayed again, and the heaven gave rain, and the earth brought forth her fruit. 19 Brethren, if any of you do err from the truth, and one convert him; 20 Let him know, that he which converteth the sinner from the error of his way shall save a soul from death, and shall hide a multitude of sins.
You really ought to read the whole thing. It is quite a beautiful chapter.
So, to answer the question,
No, the Bible doesn’t say we must keep the Law perfectly in order to be saved. The Bible does, of course, recommend it. But, although the Bible acknowledges that no man can keep the law perfectly, it is precisely the message of Scripture, from the beginning of the Old to the end of the New Testament, that God is merciful and forgiving. Therefore, if we repent of our sins, we can be saved:
Luke 18:13 But the tax collector stood off at a distance and would not even raise his eyes to heaven but beat his breast and prayed, ‘O God, be merciful to me a sinner.’
A humble and contrite heart, the Lord will not turn away.