The Book of Romans is primarily a work of doctrine and can be divided into four sections: righteousness needed, 1:18–3:20; righteousness provided, 3:21–8:39; righteousness vindicated, 9:1–11:36; righteousness practiced, 12:1–15:13. Paul first condemns all men of their sinfulness. He expresses his desire to preach the truth of God’s Word to those in Rome. It was his hope to have assurance they were staying on the right path. He strongly points out that the gospel (Romans 1:16) is the power by which everyone is saved outlining his belief in the risen Christ.
Clearly, James seems to be saying exactly the opposite of what Paul says. The key words here, in both passages, are JUSTIFIED (or, in Today's English, "put right with God"), WORKS/DEEDS/ACTIONS (or, in NIV, "observing the law"), and FAITH (same in all versions of both passages). Not only does James echo the same words, in the same parallel structure, but he even cites exactly the same example! The passage from Paul comes near the end of the third chapter of Romans; immediately after that, opening up the fourth chapter, Paul cites the example of Abraham and says it was his faith, not his works, that justified him (Romans 4:1-3). In James 2:21-24 (the same passage noted above), Paul's very example is used against him, but with the opposite (and contradictory) conclusion, that Abraham was justified by the combination of faith with works. Not only does James use exactly the same example, but to remove any doubt that they are referring to Abraham in exactly the same context, both Paul (Romans 4:3) and James (James 2:23) refer to exactly the same scriptural reference to Abraham, in which the Old Testament scriptures say that Abraham's belief was counted to him for righteousness (see Genesis 15:6). James' use of the same examples (right down to the identical scriptural reference), same words, and parallel structure clearly suggest that this was an intentional reply/rebuttal to Paul.