As the promised Messiah, Jesus fulfilled the law and the prophets (5:17). He came teaching, preaching the gospel of the kingdom, and healing all kinds of sickness and disease (4:23).
Matthew 5-7 contain the famous “sermon on the mount” in which Jesus teaches the people the kind of righteous they had to have to “enter the kingdom of heaven” (5:20). They had to exceed the righteousness of the scribes and Pharisees. They had to go beyond what they heard (v.21,27,31,33,38,43) and live righteously inwardly and outwardly.
Jesus clarified the spirit of the law with His, “But I say unto you”s (v.22,28,32,34,39,44). He wanted them to know that righteousness is not something that is just about what a person does outwardly. True righteousness and perfect is to be perfect as God the Father is (v.48).
Of course, this type of righteousness was unattainable for the people and even for the highly respected scribes and Pharisees (5:20). But it was not unattainable for Christ (5:17-19) Who came to “fulfill all righteousness” (3:15). He is the truly righteous One and through faith in Him, we can be made righteous as well and live out the type of character and attitudes found in Matthew 5:1-12.
If God is our Father through faith in Jesus, then we are perfect and have the power to live perfect as our Father in heaven is perfect. If God is not our Father, then we fall short and can never live out the type of righteousness that pleases Him.