I can write a book on this subject, and no doubt this post will be long.. but let me give ya some verses that will boost some peoples faith in God, about their righteousness.
1st of all, let me say this.. if you have perfect right standing w/ God, ever the very righteousness of Jesus himself, then there should be no reason for a failed prayer, if its in faith (and after reading these scriptures, youll be in faith)
1st of all, when Paul in Romans mentions the LAW (being that its written to both jews and gentiles) he refers to works for the gentile.. besed on his concience..
Ro 2: Before Christ’s paid atonement:
 For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by the law;
 (For not the hearers of the law are just before God, but the doers of the law shall be justified.
 For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law unto themselves:
 Which shew the work of the law written in their hearts, their conscience also bearing witness, and their thoughts the mean while accusing or else excusing one another
 In the day when God shall judge the secrets of men by Jesus Christ according to my gospel.
After Christ’s atonement:
 But now the righteousness (right standing w/ God) of God without the law is manifested, being witnessed by the law and the prophets;
 Even the righteousness of God which is by faith of Jesus Christ unto all and upon all them that believe: for there is no difference:
 For all have sinned, and come short of the glory of Godnobody can be good enough.. before or after you accept Christ)
 Being justified (just as if you never sinned) freely by his grace through the redemption that is in Christ Jesus:
 Whom God hath set forth to be a propitiation through faith in his blood, to declare his righteousness for the remission of sins that are past, through the forbearance of God;
 To declare, I say, at this time his righteousness: that he might be just, and the justifier of him which believeth in Jesus.(this is what counts- that you believe in Him)
 Where is boasting then? It is excluded. By what law? of works? Nay: but by the law of faith.(nobody can boast that they are any better, because the same grace makes us all the same amount righteous)
 Therefore we conclude that a man is justified by faith without the deeds of the law.(or works)
 Now to him that worketh (does works) is the reward (any reward-answered prayer or blessings) not reckoned of grace, but of debt.
 But to him that worketh not (at least the sin of omission), but believeth on him that justifieth the ungodly, his faith is counted for righteousness. (even if you show no works at all after faith- however, as evidence of God inside, you will show works anyways)
 Even as David also describeth the blessedness of the man, unto whom God imputeth righteousness without works,
 Saying, Blessed are they whose iniquities are forgiven, and whose sins are covered.
 Blessed is the man to whom the Lord will not impute sin.
(God is not couning sins against you anymore-if you believe in Jesus)
 For the promise, that he should be the heir of the world (Abs blessings-prospertity), was not to Abraham, or to his seed, through the law, but through the righteousness of faith.
 Therefore it is of faith, that it might be by grace; to the end the promise might be sure to all the seed;
 Therefore being justified by faith, we have peace with God through our Lord Jesus Christ:
 For if by one man’s offence death reigned by one; much more they which receive abundance of grace and of the gift of righteousness (recieve righteousness as a gift-not to be earned) shall reign in life by one, Jesus Christ
 There is therefore now no condemnation to them which are in Christ Jesus, who walk not after the flesh, but after the Spirit.
 For the law of the Spirit of life in Christ Jesus hath made me free from the law of sin and death.
 For what the law could not do, in that it was weak through the flesh, God sending his own Son in the likeness of sinful flesh, and for sin, condemned sin in the flesh:
 That the righteousness of the law might be fulfilled in us
(the blessings of the Law are ours)
 Christ hath redeemed us from the curse of the law, being made a curse for us: for it is written, Cursed is every one that hangeth on a tree:
 That the blessing of Abraham might come on the Gentiles through Jesus Christ; that we might receive the promise of the Spirit through faith.
 The eyes of the LORD are upon the righteous, and his ears are open unto their cry.
 The righteous cry, and the LORD heareth, and delivereth them out of all their troubles.
 Many are the afflictions of the righteous: but the LORD delivereth him out of them all.
 But the salvation of the righteous is of the LORD: he is their strength in the time of trouble.
 Cast thy burden upon the LORD, and he shall sustain thee: he shall never suffer the righteous to be moved.
 The LORD openeth the eyes of the blind: the LORD raiseth them that are bowed down: the LORD loveth the righteous:
 In the house of the righteous is much treasure
 And I say unto you, Ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened unto you.
 For every one that asketh receiveth; and he that seeketh findeth; and to him that knocketh it shall be opened.
 If a son shall ask bread of any of you that is a father, will he give him a stone? or if he ask a fish, will he for a fish give him a serpent?
 Or if he shall ask an egg, will he offer him a scorpion?
 If ye then, being evil, know how to give good gifts unto your children: how much more shall your heavenly Father give the Holy Spirit to them that ask him?
 And whatsoever ye shall ask in my name, that will I do, that the Father may be glorified in the Son.
 If ye shall ask any thing in my name, I will do it.
 And in that day ye shall ask me nothing. Verily, verily, I say unto you, Whatsoever ye shall ask the Father in my name, he will give it you.
 Hitherto have ye asked nothing in my name: ask, and ye shall receive, that your joy may be full.