Metonymy is a figure of speech where something is not called by its own name or description, but by something closely related. For example, the White house for a Presidential administration, or Hollywood for the film industry.
It is possible that the "righteousness of God" does not actually refer to God's perfection, His own righteousness, but rather is used metonymically for God's redemptive work through Christ.
Thus to be seeking the righteousness of God through (by means of) faith in Christ actually refers to seeking redemption in Christ where we are made perfect, holy and blameless, thus having the righteousness (perfection) of God.
Lets see if this possibility works for the verses that use the phrase.
Romans 1:17, For in it the
righteousness of God is revealed from faith to faith; as it is written, “But the righteous man shall live by faith.”
The "it" at the beginning of the verse refers to the gospel of Christ. Faith to faith is understood in various ways, but the simplest idea is from beginning to end, thus God's revelation is from beginning to end about redemption in Christ Jesus. Thus, God's redemptive work by means of Christ is revealed in the gospel, from beginning to end.
Romans 3:5, "But if our unrighteousness demonstrates the
righteousness of God, what shall we say? The God who inflicts wrath is not unrighteous, is He? (I am speaking in human terms.)"
The Greek word translated "demonstrates" means highlights, makes more clear or in other words demonstrates the need for the redemptive work of God through Christ.
Romans 3:21, But now apart from the Law the
righteousness of God has been manifested, being witnessed by the Law and the Prophets,
Here we see that the redemptive work of God through Christ is apart from the work of the Law which brings knowledge of our sin. And this redemptive work is witnessed in the Old Testament scriptures.
Romans 3:22, even the
righteousness of God through faith in Jesus Christ for all those who believe; for there is no distinction;
This verse strongly suggests that the righteousness of God is being used metonymically for God's redemptive work through faith in Jesus Christ.
Romans 10:3, For not knowing about God’s righteousness and seeking to establish their own, they did not subject themselves to the
righteousness of God.
Here we see the lost have the opportunity to subject themselves to the redemptive work of God by means of putting their faith in Christ Jesus. The cause of the failure in this case is ignorance of the gospel, rather than a lack of spiritual ability.
2 Corinthians 5:21, He made Him who knew no sin to be sin on our behalf, so that we might become the
righteousness of God in Him.
Lets sidestep the mistaken view that Jesus became sin, rather on the cross the Lamb of God became a sin offering. What is key to the topic is that we obtain the righteousness of God when God puts us "in Him" where we are made perfect, holy and blameless, i.e. made righteous.