One problem in Christianity is how to reconcile certain parts of the Old Testament, such as scenes where God is depicted as ordering mass slaughter or genocide, with the core messages of the New Testament, such as ‘love you enemies and pray for those who persecute you’.
One simple way to reconcile these things is to say the Old Testament authors are wrong in various places where they depict God as wanting to, say, mass kill all the first born Egyptians. Yet, Jesus repeatedly speaks highly of the Old Testament, repeatedly referring to it and using it as an integral part of certain moral reasonings. Yet, he doesn’t refer to the specific, problematic passages, and so his view on those things is not as clear.
To this, one place to point is in Matthew 5:18. Jesus says “For verily I say unto you, Till heaven and earth pass, one jot or one tittle shall in no wise pass from the law, till all be fulfilled.” A jot or tittle means every tiny little stroke. Is he endorsing an inerrant view of the Pentateuch here?
I don’t think he is, because the emphasis seems to be on the laws within the Pentateuch, not every story in it, and in particular on seemingly little aspects of those laws, as the next line suggests. “Whosoever therefore shall break one of these least commandments, and shall teach men so, he shall be called the least in the kingdom of heaven: but whosoever shall do and teach them, the same shall be called great in the kingdom of heaven.” Jesus then goes on to give 6 ‘It has been said to you … but I say to you’, emphasizing seemingly little things, like being angry, having lustful thoughts, and so on. He is saying these seemingly little things are actually quite important – more important, in a sense, than the big ones like murder, adultery, and so on.
So, the gist of Matthew 5:18 and following passages is that seemingly little stuff in the law is actually quite important. Jesus hasn’t come to abolish the laws, but to fulfill the spirit of them, and this is being done by a radical re-emphasis and augmentation of the laws given in the Pentateuch.
So, in context, it doesn’t seem the point of Jesus’ statement is to uphold an inerrant view of everything in the Pentateuch, but rather to uphold a more refined view of the laws within it.