How can one create a math quiz that allows students to see the correct way to work the problem if they answer it wrong after they submit? The can see the "comments" (the way to work the problem) if it is answered right, but not if it is answered wrong.

Are you using the "Formula" quiz question type? Like other question types, it has a place to enter comments the student sees when the answer is correct, comments the student sees when the answer is incorrect, and "general" comments.

How do I create a Simple Formula quiz question?