Works of the Law
To properly understand this, we must look at the historical context. As we read in the Acts, there was a group in the early Church called the “Judaizers,”1 which taught that Gentile converts to Christianity must be circumcised and follow the kosher laws.
Paul says in no uncertain terms that those trying to be saved through these Old Testament works of the Law have rejected Christ and lost their salvation.
The attitude of the Judaizers is contrasted with the faith of Abraham,2 who trusted and obeyed God even to the point of offering his own son, Isaac. Paul’s point is not that our works have no bearing on our salvation, but rather that these particular Jewish rituals were not necessary for eternal life.
For the same Romans that teaches “a man is justified by faith apart from works of the law,”3 also says that God “shows no partiality … [for] he will render to everyone according to his works..” 4
There is no contradiction, as long as we correctly understand what Paul meant by the works of the law.
1 – cf. Acts 15:1-6, etc.
2 – Rom. 4:1ff
3 – 3:28
4 – 2:6-10