Then learn when new knowledge is offered to you, and apologize if you offend (not "I'm sorry that you're offended", all too often the clarion call of people who think "SJW" is a pejorative), and be better as a person afterwards.
It's funny, but I feel a strong aversion at apologizing for offending someone when I didn't mean to. (I'm not being sarcastic).
Having thought about it, it doesn't really make sense, since I'd apologize for hitting someone even if I didn't mean to, and even if I couldn't be reasonably expected to hit them.
I think it's like this. You stumble, smack into someone, and you apologize. Your apology is for hitting them, not for meaning to hit them. In fact, you did not mean to hit them, you just stumbled.
But when the issue is offense, you don't want to apologize, because you think that they think that you meant to cause offense, and apologizing will reinforce in their mind the idea that you really did mean to do it, or at least in your mind it will reinforce that idea in their mind. And you don't want to reinforce that idea in their mind, partly because it makes you look bad, and partly because the idea is simply wrong. So you don't want to apologize.
(Note well: "you" here means "me, too, given the right circumstances".)
Worse: That may really be going on in the other person's mind. They may really think (or at least suspect) that you meant to cause offense, and therefore are determined that you must apologize as penance or proof of repentance or some such. "The good of society demands that I force this person to apologize!"
So maybe the best answer is to say something like: "I did not intend or wish to give offense. Apparently I did; I apologize for doing so." Because the fact is, the offense was real. Apologizing for it is just good manners. But apologize without agreeing that you had intent.
This presumes that you didn't have intent. If you intended to offend, that's a whole different situation. It's worthy of an apology, not just for the offense, but for the intent.
A lot of people do, myself totally included! I'm a prideful person. I try not to be, but I mean...I am. But there are ways to offend, even inadvertently, that definitely deserve a "shit, my bad, sorry." Apologies don't hurt, even my pride, all that much. Everybody screws up.
I haven't seen any "you're an asshole" type comments in here--more "aw, c'mon, man." (I frown more at whatever instructors the author had in 20th century history a lot more than the author himself. This is something that's not that obscure, but you gotta know it exists to know about it.)
Ain't that hard.