You are right here. If you have faith and receive Grace, then you will do the good and avoid sin.I do not do this. I have faith in God. My obedience is the result or outcome of my faith. I obey in faith. I obey because of faith. The question is if faith is obedience and if faith is a result, product, or outcome, of the Spirit of God or the work of the Spirit of God or the work of the Spirit of God in the believer or in the life of the believer.
There is no problem with the Law.
It is when your faith is weak and without Grace you try to obey the law, you always will fail.
James is looking at those who claim to be saved, for a sign that the Holy Spirit is guiding them away from sin.