The law, refers here to the Mosaic law, which defines sin, as well as promoting sin as the useless effort of man for the perfection of man and the attainment of mans salvation.
Paul asks a rhetorical question, with the presumption that everyone who hears the question already knows the answer.
Death is a part of the world. Arrangements or contracts in this world, are obviously a part of this world. And death, brings to an end to, or cancels, all of those contracts.
Paul uses the example of marriage to teach this principle, of the cancellation of a contract, by means of death, wherein the contract is no longer binding on either party.
This will be described in the next couple of verses.
But with respect to the law, and with respect to sin, and more specifically with respect to the sin nature, is only binding on a person as long as a person is alive and living in this world.
When a person dies, that contract with the sin nature, is no longer binding.
By the same token, when a person believes in Jesus Christ, they symbolically share in the death of Christ, and therefore are no longer bound by the rules of sin. They are set free, and are bound by the rules of faith.
The law demands that you live a perfect life in order to be a perfect person, in order to be saved. Sin proves that no individual is capable of complying with the law, and therefore incapable of living the perfect life, and therefore incapable of obtaining salvation by means of their own effort or life.
And so long as they are alive in this world, they are bound by that relationship with sin.
The only way to break the contract with sin, is through death.
And the only way to break the contract with sin, and still remain alive, is through the death of Christ. And that death is attributed to each individual who believes in Christ, by means of their faith.
Once a contract has been dissolved by death, then you do not return to the former agreement and try to reestablish it. That would be ludicrous.
And that is what Paul is teaching in this passage.
Once you have been saved, and the arrangement you had with sin is no longer in affect, then it would be foolish to return to the rules of sin, and try to earn your way, as it were, in your spiritual life.
Unfortunately, too many people believe in Christ, and therefore are saved by means of their faith, but then return to the old ways and try to earn their way, through works, in their spiritual life. And that is contrary to the teaching of the principle of faith.