Rom 7:7 What shall we say then? Is the law sin? God forbid. Nay, I had not known sin, but by the law: for I had not known lust, except the law had said, Thou shalt not covet.
Paul does point out a fact about the law. Think of it this way until the law people’s lives were in turmoil from the effects of sin manifesting in their lives. This is like having a sickness without understanding that sickness in general even exists. So the law revealed to mankind what they were experiencing in their lives was a result of sin. If they had never been exposed to the law then they would not have realized that it was sin itself that was plaguing them. But just receiving the revelation that sin is what was causing this issue is not the cure. No, this is like one who is dying physically finally finding out the name to a terminal disease. There is no hope in knowing what is wrong if there is not a cure. Fortunately we have the cure through Jesus though. In him we find our true identities as sons of God and no longer slaves to sin for through him sin and its effects have been annihilated.