Why does the “Law” come up in Romans?
I think the point of Romans 7 and 8 is something like this. In chapter 6 Paul reasons that it is necessary for me to cease living to sin and in sin, because I have died to sin in Christ and have been raised to new life in Him. Righteous living is a necessity.
But in chapter 7 Paul goes on to show that living a righteous life—one that fulfills the law’s requirements—is impossible. This is because sin is more powerful than my flesh. I don’t have the power to do what the law requires, and what I want to do, agreeing with the law. The big question comes in the last verses of chapter 7: “Who can deliver me from this body of death?—this body which cannot defeat sin and produce righteousness? The answer is given in the first verses of chapter 8. In Christ there is no condemnation, and it is the Holy Spirit who gives me the power to live as the law requires (8:3-4). The same Spirit who raised the dead body of our Lord to life is the Spirit who raises our bodies of death (i.e. 7:24) to life (8:11).
So, in answer to your question, the body (i.e. our flesh) is always dead, so far as producing righteousness.