In Brecht's The Good Woman of Setzuan, Shen Te is chosen by the gods as the only good person left on earth. In fact, she is so kind and charitable that she cannot say no, which leaves her in dire poverty.
Even when the gods reward her with a handsome sum of money, Shen Te does not have the heart to refuse anything to the many people who come to her door. Thus she sinks back into destitution.
When Shen Te discovers that she is pregnant, her notion of goodness changes. She realizes that, unless she behaves differently, her unborn child will lead a miserable life. She sings, "To be good to you, my son/I shall be a tigress to all others/If I have to."
It is at this point that she creates a new identity, that of an inexistent male cousin called Shui Ta, a ruthless capitalist with not an ounce of compassion in him.
When the gods come back to pass judgement, Shen Te explains what she has done and concludes that she finds it impossible to be good to herself and to others at the same time.
Therefore, Shen Te embodies the dilemmas of goodness as a relative and an absolute value, and also draws attention to a gender issue. She would never have been feared and respected if she had not disguised herself as a man. Had she tried to impose her will from her female condition, she would have been scorned and imposed upon.
You need to bear in mind that the character, like the play itself, must be discussed in the light of Brecht's didactic works, in which he attempted to teach socialist ideas to ordinary people, mostly rural workers. The alienation effect that he introduced in order to prevent spectators from getting emotionally involved in the plays is also very important. An example of this are the songs. One cannot understand Shen Te's singing -other characters do too, but you are focusing on her- in a dramatic comedy unless you remember that songs are alienation devices.