.
Cain believed in God; in point of fact Cain believed in the same God that his
brother believed in and he worshipped the same God as his brother's.
However, Cain's belief was dead to God because it wasn't garnished with
piety.
• Gen 4:7a . . If you do what is right, will you not be accepted?
Cain no doubt felt very strongly that his rituals were adequate enough for
him to be counted a true believer, but that has never been true. One's
conduct is far and away more important than one's rituals.
Cain's situation is well illustrated at Isa 1:11-20. Moses' people were offering
all the covenanted sacrifices, they were praying up a storm, and observing
all the God-given feasts and holy days; bit He rejected all of it, even though
He himself required it, because the people's personal conduct was
unbecoming. That's still the rule today.
• 1John 1:6 . . If we claim to have fellowship with Him, yet walk in the
darkness, we lie and do not live by the truth.
_
You have hit the nail on the head.
Cain not only believed in God, but talked with God personally. His faith however was dead to God, because Cain wanted
to be justified with God without doing the works of God's righteousness.
Cain wanted to be accepted with God by offering up his own sacrifice to God, and so doing his own righteousness rather than God's.
This is what Scripture with Paul was rebuking, which the Jews of old had fallen into: seeking to do God's righteousness
by their own will and faith, and not by God's Word of faith. They thought themselves justified with God
by the works of their own righteousness.
Not by works of righteousness which we have done, but according to his mercy he saved us, by the washing of regeneration, and renewing of the Holy Ghost.
Then there is the faith alone crowd, that want to reject
any works of righteousness at all to be justified with God, which is what Scripture James rebukes. They consider any and all works to be anathema to their salvation and justification, which is not God's but their own.
There are two ways to self-righteousness of man:
The self-righteous thinking to be be made righteous by their own works of righteousness, which Paul rebuked, and the self-righteous thinking to be made righteous without any works of righteousness at all.
Scripture is teaching us that believing in God does not necessarily mean we believe in Him
as He is, and seeking to do our own works of righteousness is not obeying Him according to His commandment. Man can believe in the one true God, but in another way of their own faith and making, which is neither pleasing, accepted, nor justified with God.
Only them that believe God according to His Word, and do it in deed and in truth, are saved and justified with God.
Only them that have the faith of Jesus in the heart and obey Him with the whole heart are saved and justified of God.
Any other kind of faith, with or without deeds, falls short of the glory of God and shall not obtain eternal salvation at the end.
It's the same with Scripture of God. Man can believe the Scriptures are true, but then go about teaching something false of their own making about God, that they want to believe is true, but is not.