So James is clearly talking about people with fake 'faith' that doesn't do anything, and the matter of whether or not it was ever genuine and active being irrelevant to the point being made.
There is no such thing as “fake faith”.
A person either has faith from God or not.
If the person who has received faith from God doesn’t do what the word from God, the word of faith, then their faith remains in a dormant, inactive (dead) state, and is unable to function and produce the blessing that God intended.
And suddenly, a woman who had a flow of blood for twelve years came from behind and touched the hem of His garment. For she said to herself, “If only I may touch His garment, I shall be made well.” But Jesus turned around, and when He saw her He said, “
Be of good cheer, daughter; your faith has made you well.” And the woman was made well from that hour.
Matthew 9:20-22
When God moved upon, inspired, spoke to this woman’s heart to go and touch the hem of His garment, she had faith for healing for God as a gift. (An unearned, unmerited gift)
When she responded in obedience, her faith was activated to produce the intended blessing of healing.
The faith we receive from God as a gift, becomes our faith, faith that was given to us from God. When we obey the word of faith our faith we received from God is complete and activated to go from something we hope for that is unseen, to the reality of the thing we obtain.
Whether, salvation, healing, a wife or a husband or a child we have asked for, a job…. Faith works the same for anything we receive from God.
“By faith” literal means God spoke to us, and we did what He told us do.