Righteousness is not something that can be earned as a wage even through perfect obedience (Romans 4:1-5). In Romans 3:21-22, it doesn't say that the Law and the Prophets testify that the righteousness of God comes through perfect obedience, but rather the only way to become righteous that is testified about in the Law and the Prophets is through faith in Christ for all who believe. However, for someone to have a character trait means that they are a doer of that trait, so for God to be righteous means that He is a doer of righteous works, and for us to be imputed with the righteousness of God means that we are being given the gift of becoming a doer of righteous works in obedience to God's law. God's law was not given as instructions for how to become righteous, but to describe the life of someone who is righteous as it describes the life of Christ. Christ expressed the righteousness of God through setting an example for us to follow of how to walk in obedience to God's law, so that is also the way that we have the gift of getting to live when we are imputed with the righteousness of God.
Obedience to God's law has absolutely nothing to do with trying to earn our righteousness/justification/salvation/promise/eternal life as a wage, but that having those things does not involve being a doer of it through faith, so if Christ had fulfilled the law for us because we could not, then he would have been removing those things from us. In Psalms 119:29-30, he wanted to put false ways far from him, for God to be gracious to him by teaching him to obey His law, and he chose the way of faith by setting it before him, so this has always been the one and only way of salvation by grace through faith. Jesus saves us from our sin (Matthew 1:21), and sin is the transgression of God's law (1 John 3:4), so Jesus graciously teaching us to be a doer of it is intrinsically the way that he is giving us his gift of saving us from not being a doer of it, but if Jesus had fulfilled it for us instead of teaching us to be a doer of it, then he would not have been giving us the gift of saving us from not being a doer of it. "To fulfill the law" means "to cause God's will (as made known in the law) to be obeyed as it should be" (NAS Greek Lexicon), so Jesus did not fulfill the law for us so that we don't have to, but in order to teach us how to correctly be a doer of it. According to Galatians 5:14, anyone who has ever loved their neighbor has fulfilled the entire law, so again it refers correctly obeying it as it should be, moreover, it refers to something that countless people have done in accordance with the example that Christ set for us to follow.