"Do not think that I have come to abolish the Law or the Prophets;
I have not come to abolish them but to fulfill them."
These words Jesus spoke come right in the middle of his famous Sermon on the Mount. It directly follows the beatitudes and is followed by his teachings on murder, adultery, divorce, and love. In many ways, Jesus' Sermon on the Mount is a parallel to the Law (think 10 commandments) given to Moses in the Old Testament. However, in his teaching on the Law, Jesus takes everything further. Whereas Moses taught "You shall not murder", Jesus proclaimed that everyone who is even angry with his brother, or speaks insult is liable to the same judgement. Where the Law of the Old Testament said, "You shall not commit adultery", Jesus said, "everyone who looks at a woman with lustful intent has already committed adultery with her in his heart."The Old Testament allowed for a man to divorce his wife, but Jesus said that the only legitimate reason for a divorce is sexual infidelity.
What was Jesus doing here? He seems to be challenging and contrasting the ancient Law of God. These words would have undoubtedly caused his Jewish audience to question such a man claiming to usher in God's Kingdom. How can this be a man from God if he is changing what God has already given us?
This is where Matthew 5:17 comes in. What Jesus is saying here is that he came to fulfill God's own intention in the Law. The Law is meant to lead us in righteousness and point us to God's perfect moral character. Yet, in the Old Testament, the Law served more as a guide and restraint to an imperfect situation. For example, lust is an unavoidable reality among people, but instilling retribution (The Law) for such acts puts restraint on this action. However, this is incomplete; it never really gets at the heart of the action.
Jesus fulfilled the Law in that he got at the heart of the matter. Jesus wasn't interested in giving his people a minimal standard of rules so that they could live functionally as a society. He came to bring so much more than that. Jesus came to call a new people, to which he would give completely new hearts. These new hearts wouldn't be fashioned after the minimal requirements of the Law, but would be fashioned after God's heart in the Law. Therefore, it was no longer an issue of literally committing murder or adultery, but rather, as God's new people, who have been given new life and new hearts, we are living under God's loving and righteous rule and reign. Jesus is the fulfillment of the Law because he did what they Law never could do. The Law could never change hearts and give new life. Jesus came to assemble a new people who had the Law written on their new hearts, and who were free to follow God in righteousness.