Righteousness is best understood in light of relationships, particularly covenantal relationships. When you fulfil your obligations in such a relationship, you could be considered righteous.[i]
You are acting rightly and justly by faithfully fulfilling your role as husband or wife, parent or child, employer or employee, merchant or customer. Baker’s Encyclopedia of the Bible states further:
Thus, righteousness is a state of integrity in relation to God and one’s fellowman, expressing itself in one’s acts and speech.[ii]
God is the epitome of righteousness, for it is part of His character. He is holy and faithful, and therefore has, is, and always will fulfil His requirements of relationships. (See 1 Corinthians 1:9)
His righteousness is ultimately seen through His work of redemption through Christ Jesus. (See Romans 3:25–26) By the death, burial, and resurrection of Jesus Christ God has shown, in a very personal way, to what extent He will go to fulfil His requirements so that He could have a relationship with us.
Now the immediate audience to whom Jesus was addressing and to whom Matthew originally wrote, understood this relational facet of righteousness. The Mosaic covenant was rehearsed regularly within the synagogues and the temple. It is something they memorized from a child. God had promised blessings upon them if they would be faithful to His ways.
To them, their obligation as Israelite's in this covenantal relationship with God was to keep the law. As they had come to understand it, the more of the law you kept, the more righteous you were. By this definition, the most righteous individuals in Jewish society were the scribes and Pharisees. These men would go through great lengths to ensure they kept the law, and they would make sure you saw them doing it. So imagine the shock when Jesus points out the key to entering the Kingdom of Heaven. (See Matthew 5:20)
Kingdom life is a humble life. Kingdom life is a testifying life. But kingdom life is also a righteous life. Now a charge such as this would take the wind out of anybody's sails, but remember Jesus is raising the bar. Kingdom life is of a different calibre than normal earthly life, for it is a heavenly life. A life governed by wisdom from above. (See James 3:17)
[i] Kelly, R. A. (1979–1988). Righteousness. In G. W. Bromiley (Ed.), The International Standard Bible Encyclopedia, Revised (Vol. 4, p. 193). Wm. B. Eerdmans.
[ii] Elwell, W. A., & Beitzel, B. J. (1988). Righteousness. In Baker encyclopedia of the Bible (Vol. 2, p. 1861). Grand Rapids, MI: Baker Book House.