Our question in this topic is how to identify the counterfeit "righteousness". Here is the best way that I have found. Again, not by one or two verses, but by many that make it impossible to misunderstand what is being said.
Galations 5:16 [This] I say then, Walk in the Spirit, and ye shall not fulfil the lust of the flesh.
5:17 For the flesh lusteth against the Spirit, and the Spirit against the flesh: and these are contrary the one to the other: so that ye cannot do the things that ye would.
5:18 But if ye be led of the Spirit, ye are not under the law.
5:19 Now the works of the flesh are manifest, which are [these]; Adultery, fornication, uncleanness, lasciviousness,
5:20 Idolatry, witchcraft, hatred, variance, emulations, wrath, strife, seditions, heresies,
5:21 Envyings, murders, drunkenness, revellings, and such like: of the which I tell you before, as I have also told [you] in time past, that they which do such things shall not inherit the kingdom of God.
5:22 But the fruit of the Spirit is love, joy, peace, longsuffering, gentleness, goodness, faith,
5:23 Meekness, temperance: against such there is no law.
5:24 And they that are Christ's have crucified the flesh with the affections and lusts
If we have Jesus in the heart, if we abide in Him, then we have His Spirit. If we have His Spirit, we may keep the wrong day, eat the wrong food, wear the wrong clothes, but there is a way to know that the heart is given to Christ, we have His Spirit. And this is manifested in the life. The fruit of His Spirit is seen. Not one of the fruits of the Spirit are missing in those who are truly converted, for they have Christ within. And, as Jesus said, the truly converted Christian does not bear bad fruit. The works of the flesh do not manifest themselves in those who are filled with the Spirit of God.
We may know not only the false teacher, but we may know if we be in the faith, by the fruits of the Spirit revealed in the life.
Just in case someone may question the context of the above verses, here is the same lesson given by Paul in the Book of Romans:
8:1 [There is] therefore now no condemnation to them which are in Christ Jesus, who walk not after the flesh, but after the Spirit.
8:2 For the law of the Spirit of life in Christ Jesus hath made me free from the law of sin and death.
8:3 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:
8:4 That the righteousness of the law might be fulfilled in us, who walk not after the flesh, but after the Spirit.
8:5 For they that are after the flesh do mind the things of the flesh; but they that are after the Spirit the things of the Spirit.
8:6 For to be carnally minded [is] death; but to be spiritually minded [is] life and peace.
8:7 Because the carnal mind [is] enmity against God: for it is not subject to the law of God, neither indeed can be.
8:8 So then they that are in the flesh cannot please God.
8:9 But ye are not in the flesh, but in the Spirit, if so be that the Spirit of God dwell in you. Now if any man have not the Spirit of Christ, he is none of his.
8:10 And if Christ [be] in you, the body [is] dead because of sin; but the Spirit [is] life because of righteousness.
8:11 But if the Spirit of him that raised up Jesus from the dead dwell in you, he that raised up Christ from the dead shall also quicken your mortal bodies by his Spirit that dwelleth in you.
8:12 Therefore, brethren, we are debtors, not to the flesh, to live after the flesh.
8:13 For if ye live after the flesh, ye shall die: but if ye through the Spirit do mortify the deeds of the body, ye shall live.
8:14 For as many as are led by the Spirit of God, they are the sons of God.
The counterfeit righteousness professes to keep the law of God when in fact the Spirit is not present.