It's a question I was studying a couple of weeks ago.
I already knew from the surrounding chapters, that Paul was definitely not justifying sin, and yet I wanted a better understanding of these particular verses (the ones you have referenced).
I actually found a good answer a couple of weeks ago, on this very site, from @Steve can help. See hereIs Romans 7:17,20 excusing the true believer from weakness which leads to sin?
Here's the excerpt that was most helpful to me:
No, your suggestion is pretty much the opposite of the author's point, because you've isolated two verses from everything that surrounds them, and so end up losing their intended meaning.
Paul's overall purpose in this text is that he is writing to a mixture of believers in Rome, many of whom are Jews. These believers have disagreements with their Gentile brothers over how best to live. And so in Romans one of his priorities is to make a case to explain that following the law is not the means to a good life.
The point is not to excuse anybody, but rather to point out that all the recipients - Jews and Gentiles - are in largely the same boat, and following the law will not help them live without sin. In order to live without sin, all of them must take hold of the Son of God, who dealt with that sin in the flesh, and enabled Christians to live according to the Spirit instead.
I agree with @Steve can help. Paul is clearly not excusing anyone, otherwise he wouldn't have challenged those very excuses in places like Romans 6:1, Romans 6:15, and Romans 8:12.
In the verses you cite, Paul is not explaining "who am I?", but rather "what am I?" i.e. like a computer virus, sin had entered his system and impaired all operations from functioning to their original design. In Romans chapter 7, Paul is not yet presenting the good news of the Spirit's enabling. He wants us first to understand our profound inability, apart from Christ.