How about I talked back to a teacher and she forced me to apologize?
DId you apologize like she told you to? Why did you talk back to her to start with?
I don't like her, I think she's an asshole. But I'll apologize anyway.
If you are disrespectful to your teacher, you can expect you'll get in trouble and have to apologize. You should not do things that antagonize your teacher, even if you do think she's an asshole.
Yeah, I guess it was wrong.
It's great that you are able to admit what the right behavior would be. Apologizing after talking back is the most appropriate thing to do.