One of the problems in the current conversation regarding the relationship between law and gospel is that the term "law" is not always used to mean the same thing. This is understandable since in the Bible "law" does not always mean the same thing.
For example, in Psalm 40:8 we read: "I delight to do your will, O my God; your law is within my heart." Here the law is synonymous with God's revealed will. A Christian seeking to express their love for God and neighbor delights in those passages that declare what God's will is. When, however, Paul tells Christians that they are no longer under the law (Rom. 6:14) he obviously means more by law than the revealed will of God. He's talking there about Christians being free from the curse of the law–not needing to depend on adherence to the law to establish our relationship to God: "Christ is the end of the law for righteousness to everyone who believes" (Rom. 10:4).
So, it's not as simple as you might think. For short hand, I think it's helpful to say that law is anything in the Bible that says "do", while gospel is anything in the Bible that says "done"; law equals imperative and gospel equals indicative. However, when you begin to parse things out more precisely, you discover some important nuances that should significantly help the conversation forward so that people who are basically saying the same thing aren't speaking different languages and talking right past one another.
In an attempt to be a little more precise, here are some thoughts (big shout-out to my friend Jono Linebaugh who has helped me tremendously in thinking these things through).
When, for instance, the Apostle Paul speaks about the law he routinely speaks of it as a command attached to a condition. In other words, law is a demand within a conditional framework. This is why he selects Leviticus 18:5b (both in Gal. 3 and Rom. 10) as a summary of the salvation-structure of the law: "if you keep the commandments, then you will live." Here, there is a promise of life linked to the condition of doing the commandments and a corresponding threat for not doing them: "cursed is everyone who does not abide in all the things written in the Book of the Law, to do them" (Gal 3.10 citing Deut 27.26). When this conditional word encounters the sinful human, the outcome is inevitable: "the whole world is guilty before God" (Rom 3.19). It is the condition that does the work of condemnation. "Ifs" kill!
Compare this to a couple examples of New Testament imperatives. First, consider Galatians 5.1. After four chapters of passionate insistence that justification is by faith apart from works of the law, Paul issues a couple of strong imperatives: "It was for freedom that Christ set us free; therefore stand firm (imperative) and do not be subject (imperative) again to the yoke of slavery." Are these commandments with conditions? No! Are these imperatives equal to Paul's description of the law? No! The command here is precisely to not return to the law; it is an imperative to stand firm in freedom from the law.
Let's say you're a pastor and a college student comes to you for advice. He's worn out because of the amount of things he's involved in. He's in a fraternity, playing basketball, running track, waiting tables, and taking 16 hours of credit. The pressure he feels from his family to "do it all" and "make something of himself" is making him crazy and wearing him down. After explaining his situation to you, you look at him and explain the gospel–that because Jesus paid it all we are free from the need to do it all. Our identity, worth, and value is not anchored in what we can accomplish but in what Jesus accomplished for us. Then you issue an imperative: "Now, quit track and drop one class." Does he hear this as bad news or good news? Good news, of course. This very idea of knowing he can let something go brings him much needed relief–he can smell freedom. Like Galatians 5:1, the directive you issue to the student is a directive to not submit to the slavery of a command with a condition (law): "if you do more and try harder, you will make something of yourself and therefore find life." This is good news!
Or take another example, John 8.11. Once the accusers of the adulterous women left, Jesus said to her, "Neither do I condemn you. Depart. From now on, sin no more." Does this final imperative disqualify the words of mercy? Is this a commandment with a condition? No! Otherwise Jesus would have instead said, "If you go and sin no more, then neither will I condemn you." But Jesus said, "Neither do I condemn you. Go and sin no more." The command is not a condition. "Neither do I condemn you" is categorical and unconditional, it comes with no strings attached. "Neither do I condemn you" creates an unconditional context within which "go and sin no more" is not an "if." The only "if" the gospel knows is this: "if anyone sins, we have an advocate with the Father, Jesus Christ the Righteous" (1 John 2.1).
The reason Paul says that Christ is the end of this law is that in the gospel God unconditionally gives the righteousness that the law demands conditionally. So Christ kicks the law out of the conscience by overcoming the voice of condemnation produced by the condition of the law. As I said in my previous post, the conditional voice that says "Do this and live" gets out-volumed by the unconditional voice that says "It is finished."
When this happens, we are freed from the condemnation of the law's conditionality (the "law" loses its teeth) and therefore free to hear the law's content as a description of what a free life looks like. In other words, the gospel ends the law's role as the regulator of the divine-human relationship and limits the law to being a blueprint for the free life. So, the law serves Christians by showing us what freedom on the ground looks like. But everyday in various ways we disobey and stubbornly ignore the call to be free, "submitting ourselves once again to a yoke of slavery." And when we do, it is the gospel which brings comfort by reminding us that God's love for us doesn't depend on what we do (or fail to do) but on what Christ has done for us. Jesus fulfilled all of God's holy conditions so that our relationship to God could be wholly unconditional. "There is therefore now no condemnation for those that are in Christ Jesus" (Romans 8:1). The gospel, therefore, always has the last word over a believer. Always
For Martin Luther, it is within this unconditional context created by the gospel–the reality he called "living by faith"–that the law understood as God's good commands can be returned to its proper place. Freed from the burden and bondage of attempting to use the law to establish our righteousness before God, Christians are free to look to commandments, and "imperatives, not as conditions, but as descriptions and directions as they seek to serve their neighbor. The law, in other words, norms neighbor love–it shows us what to do and how to do it. Once a person is liberated from the commonsense delusion that keeping the rules makes us right with God, and in faith believes the counter-intuitive reality that being made righteous by God's forgiving and resurrecting word precedes and produces loving action (defined as serving our neighbor), then the justified person is unlocked to love–which is the fulfillment of the law.