Mrs. Dubose serves as model of two concepts: courage and discipline.
Mrs. Dubose's problem of addiction elicits her effort to free herself. As an old woman who is taking morphine for some type of pain, we know that she has reason to be cranky as readers. The children however, think she is just mean. If she is in continual conflict with her body but trying to die free from addiction she has to practice both courage and discipline. It takes bravery to to allow her own body to endure the pain when she knows there is a quick fix for the pain if she chooses to use it. Additionally it takes discipline, the kind of discipline that is the practice of doing something right over and over, to be able to achieve longer and longer lengths between her doses of morphine.
The practice of that actually disciplines Jem as well because he has to read to her for longer and longer each time. Jem deserved discipline as in a punishment for his crime of destroying her flowers.
Teaching courage and discipline were both necessary because of what Atticus and the children were about to endure from the town. It helped teach the children a lesson about patience and keeping their cool when other people say terrible things that just demonstrate heated emotions.