"Who shall lay anything to the charge of God's elect? It is God who justifies." (Romans 8:33)
Righteousness is "the quality or state of being right", or conversely, "the absence of wrongness". Comparatively, wetness is "the quality or state of being wet; the absence of dryness." In the Bible righteousness is used in a moral context. God designed human beings to be a certain way both physically and morally. If we are the way we are meant to be physically we are physically whole. If we are the way we are meant to be morally, we are morally whole, ie. righteous. If we are not the way we are meant to be morally, we are unrighteous. No one is righteous before God by their own works because we all sin and fall short of the glory of God. God is morally right; people are not. In God there is an absence of all moral wrongness. In people there is not.
While Noah was not the first righteous person on earth, he is the first person in the Bible to be explicitly called righteous. We learn much about righteousness from considering this first mention of it:
"Noah was a righteous man, blameless in his generation, and Noah walked with God." (Gen. 6:9)
"God looked on the earth, and behold, it was corrupt; for all flesh had corrupted their way upon the earth." (Gen. 6:12)
""Enter the ark, you and all your household, for you alone I have seen to be righteous before Me in this time." (Gen. 7:1)
When God looked at everyone else He saw that they had "corrupted their way". That is, what they were meant to be they were not; they had spoiled themselves morally, and were not as they should be, ie. they were unrighteous. When God looked at Noah He saw a man who hadn't corrupted his way and was as he was meant to be, ie. righteous. The parallel to and explanation of "righteous" in this verse is "blameless". That is, Noah was morally blameless, ie. he was in a state where there was an absence of moral wrongness. Blamelessness is the equivalent of righteousness because God did not mean for us to have any sin or blame or to be morally crooked in any way. When we are what God designed us to be we are sinless and blameless, and thus righteous. Here, in the very first description of a righteous man, we see that righteousness involves blamelessness. Anyone who is not blameless is not righteous. Anyone who has some moral wrongness does not possess the quality or state of moral rightness.
Job is another early individual who is explicitly called righteous in the Bible. We see the very same description of righteousness in his case:
"There was a man in the land of Uz whose name was Job; and that man was blameless, upright, fearing God and turning away from evil." (Job 1:1)
Once again, Job's righteousness is explained as blamelessness. We see again that if a person is not blameless they are not righteous. The rest of the book of Job revolves around this matter of righteousness. Notice that Job goes to great pains to maintain his blamelessness. That is, Job argues that he has not sinned while his friends argue that he must have sinned. His friends get upset with Job for saying that he is more righteous than God (ie. "if you didn't sin then you are blameless, and God is to be blamed for punishing you for nothing!" So their argument goes). Thus we are again instructed about righteousness early on in the Bible. Righteousness = blamelessness. No blamelessness = no righteousness.
The place to learn about righteousness (the place where God Himself intends to teach us about it) is in the law of Moses. Righteousness is the central concept in the law.
"It will be righteousness for us if we are careful to observe all these commandments before the LORD our God, just as He commanded us." (Deut. 6:25)
The law sets forth the rule or standard of righteousness, so that if you keep the law you are righteous and if you don't keep the law you are unrighteous. Keeping the law = righteousness. Not keeping the law = unrighteousness. The law is essentially a moral code concerned with our relationship with God and our relationship with our neighbors (so the prophets and Jesus testify; ex. Hab. 1:2-4, Matt. 22:40). It no doubt has a ceremonial aspect to it, but this is not to eclipse the central moral concern of the law (as the prophets were always saying!) Most importantly, life or death, blessing or cursing, depends upon obedience to the law. If you obey the law (ie. are righteous) you will have life and blessing. If you disobey the law (ie. are unrighteous) you will have death and cursing (see Ezekiel 18 for an important example). There is a constant repetition of this theme throughout the entire Bible that "righteousness brings life" and "unrighteousness brings death" (ex. Prov. 10:16). The book of life is the book of the righteous (Ps. 69:28). Not righteous = not in the book of life. Israel seeks righteousness by obedience to the law (Acts 26:7, Rom. 9:31, 10:1-4). This only ends in failure and cursing. Jesus Himself often turned to the law when explaining what righteousness consists of (ex. Matt. 5:20-48, Luke 10:25-29). It is significant that in each case, Jesus defines righteousness as perfection.
"Be perfect, therefore [in the light of what I have been saying], as your heavenly Father is perfect." (Matt. 5:48)
"One thing you lack: if you wish to be perfect, go and sell your possessions and give to the poor..." (Matt. 19:21 & Mark 10:21)
Jesus taught that righteousness is blamelessness. One must have no sin in order to enter into the kingdom of God and not be cast into hell. Jesus took the commands of the law so seriously that He taught that violating even the very least commandment made you the least in the eyes of the kingdom of heaven, and that if your hand or eye causes you to sin you should cut it off. Sin = go to hell. Not going to hell = no sin. That's the strict teaching of Jesus that hardly anyone takes seriously.
In a nutshell, Jesus taught that righteousness was blamelessness because He taught that righteousness consists in keeping the law, and that the law was fulfilled by "loving God with all your heart, all your soul, all your mind, all your strength" (meaning, totally, wholly, completely), and "loving your neighbor as yourself" (meaning totally, wholly, completely). If you don't love God and your neighbor this way (ie. perfectly), you aren't fulfilling the law, and if you aren't fulfilling the law, you aren't righteous; and if you aren't righteous, you aren't going to inherit eternal life but are going to go to hell. This is the teaching of Jesus on the law and righteousness.
To summarize: righteousness is law-keeping which is blamelessness which brings blessing:
"How blessed are those whose way is blameless, Who walk in the law of the LORD." (Ps. 119:1; first verse in the major Psalm about the law)
If a person does not love God with all his heart, soul, mind and strength and does not love his neighbor as himself, that person is not righteous.
Righteousness is what is required to inherit the kingdom of God (ex. Matt. 5:20, 6:33, 25:46, etc.) This is because there is a day of judgment coming (so the prophets, Jesus and apostles) which will determine every man's eternal destiny, and the deciding factor is righteousness (ex. Acts 17:31; see also Rom. 2:6-13 which is the first mention of "justified" in the Book of Romans). God is full of wrath against man's unrighteousness (Rom. 1:18), and it is this wrath we are to flee from (Luke 3:7, 1 Thess. 1:10) and be saved from (Rom. 5:9).
The problem is stated by Paul clearly in Romans, in the context of the coming judgment:
"By the works of the Law no flesh will be justified in His sight, for through the law is the knowledge of sin." (Rom. 3:20)
There is no hope for mankind in being righteous and therefore justified by God on judgment day through obedience to the law. Not because the law is flawed, but because we are. The law will always find us morally unrighteous.
The whole point of the gospel of Jesus Christ is the revelation of the righteousness of God through faith:
"For I am not ashamed of the gospel, for it is the power of God for salvation to everyone who believes, to the Jew first and also to the Greek. For in it the righteousness of God is revealed from faith to faith; as it is written, "But the righteous by faith shall live." (Rom. 1:16-17)
"But now apart from the Law the righteousness of God has been manifested, being witnessed by the Law and the Prophets, even the righteousness of God through faith in Jesus Christ for all those who believe; for there is no distinction; for all have sinned and fall short of the glory of God, being justified as a gift by His grace through the redemption which is in Christ Jesus; whom God displayed publicly as a propitiation in His blood through faith. This was to demonstrate His righteousness, because in the forbearance of God He passed over the sins previously committed; for the demonstration, I say, of His righteousness at the present time, so that He would be just and the justifier of the one who has faith in Jesus.' Where then is boasting? It is excluded. By what kind of law? Of works? No, but by a law of faith. For we maintain that a man is justified by faith apart from works of the Law." (Rom. 3:21-28)
Because blamelessness is required, and none of us are blameless, God sent Christ to be the propitiatory sacrifice for our sins so that whoever believes in Him will be found blameless before God on account of that sacrifice. Christ died for our sins because God is a just God who cannot lower His standard of righteousness. The wages of sin is death and God will not fail to punish sin (Ex. 34:7, Josh. 24:19). The point of the cross is the tension between God's righteous standard and His love. God, being righteous, is wrathful against us for our unrighteousness and must deal with our sin. But God, being love, does not want us to perish but wants us to be saved. Therefore God, instead of punishing us for our sins, provided Christ as a substitutionary sacrifice for our sins, so that by laying our sins upon Him (Isaiah 53:6) we may be justified through believing/resting/trusting in Him. This mystery of Christ crucified upholds the justice of God and extends peace to sinners, while at the same time revealing to us the true nature of God as a righteous and loving God. Without this mystery we cannot know God.
Paul moves forward in chapter 4 of Romans to show how Abraham and David were righteous through faith, without any works of their own (despite their sinfulness, for God justifies the ungodly):
"Now to the one who works, his wage is not credited as a favor, but as what is due. But to the one who does not work, but believes in Him who justifies the ungodly, his faith is credited as righteousness, just as David also speaks of the blessing on the man to whom God credits righteousness apart from works: blessed are those whose lawless deeds have been forgiven, and whose sins have been covered. Blessed is the man whose sin the Lord will not take into account." (Rom. 4:4-8)
Notice how the righteousness spoken of here is the righteousness that the ungodly receive through faith. Notice also that righteousness is blamelessness, for God does not take any of the believers sins into account. He removes all our sins as far as the east is from the west (Ps. 103:12) through Jesus Christ.
This is precisely why Jesus calls on people to believe in Him in the Isaiah 55 manner, so that they can have eternal life. Christ came for sinners, and to sinners He made His appeal. We need a Savior because we are unrighteous. If we were not unrighteous, or if God didn't require righteousness, Christ would not have needed to come and die for us. Christ came to serve us by giving His life a ransom for us (Mark 10:45).
Jesus said that His body was broken and His blood was shed for the remission of our sins (Matt. 26:28). He is the Lamb of God who takes away the sins of the world (John 1:29). We need Christ's sacrifice because we need righteousness. Christ provides righteousness for us through His death on the cross, by bearing our sins, and based upon this He calls us to trust in Him. He Himself brought the promised "everlasting righteousness" (Dan. 9:24) that is sufficient for every man. One day Israel as a nation will receive this righteousness by faith, and will finally be blessed. Israel's own story is an illustration that righteousness (and therefore blessing) does not come by the law, but comes only through faith in Jesus Christ. One day Israel, too, will believe and will "all be righteous." (Is. 60:1)
These facts show us that Noah and Job were not righteous because of their own works, but because they, too, were men of faith. The book of Hebrews makes this explicit:
"By faith Noah, being warned by God about things not yet seen, in reverence prepared an ark for the salvation of his household, by which he condemned the world, and became an heir of the righteousness which is according to faith." (Heb. 11:7)
Going back to Genesis 6, Noah was righteous/blameless, and the reason is given: "he walked with God." This phrase indicates, not that Noah physically walked with God, nor that Noah met the standard of righteousness by his works (for no one does: Ps. 143:2, Job 15:14, Prov. 20:9, Eccl. 7:20, 1 John 1:8, etc.), but is simply an idiomatic way of saying that Noah agreed with God. That is, Noah, like Abel, understood righteousness and agreed with God that he was a sinner in need of salvation through Christ. He put his hope in righteousness through faith, not in righteousness through works. He waited for Christ to come and bring him life.
Noah had the same hope Job expresses:
"As for me, I know that my Redeemer lives, And at the last He will take His stand on the earth. Even after my skin is destroyed, Yet from my flesh I shall see God." (Job 19:25)
Job was hoping in His Redeemer who could deliver Him from death. Job, like Abel, was a man of sacrifice (Job 1:5), looking ahead to the coming of Christ. For this reason Job, Abraham, Noah, David (Ps. 22) and all the saints of old were blameless in God's sight. They knew they needed blamelessness, didn't have it in themselves, and looked for it in Christ to come. Because of this faith they were in fact blameless through Christ. Christians shall in the future take their seat with Abraham, Isaac and Jacob in the kingdom of God because they all share the same hope in Christ providing righteousness for sinners.
Righteousness is the key issue. No righteousness = no eternal life. No blamelessness = no righteousness. It is precisely because we are not blameless by our works that we need Jesus Christ and His sacrifice. If we could be righteous by our works, Christ died for nothing (Gal. 2:21).