Racism isn't something you're born with.
At best you can call it a manifestation of several different human traits combined.
The first is impossible to eliminate because it underpins part of what makes us intelligent:
The ability to group related things together.
Why are cars and trees different? That's discrimination! (A joke obviously, though not entirely. being discriminating is sometimes taken in this context. Because what it means, if you take away all the other implications, is "to tell things apart". - In other words, to say that two things are different.)
The other, would seem to be in-group and out-group mentality.
Fanboys are an obvious manifestation of this...
Sony fans hating microsoft products and praising Sony ones, (and vice versa) is one example of this.
Frequently, you defend your 'in' group even when it's obvious there's something bad or stupid involved in doing so...
And attack the 'out' group even when there's nothing about such a group that warrants the way you're attacking them.
That's the origins of the problem, pretty much.
But everything else around it isn't set in stone.
It isn't hardwired anywhere for one person to hate some other person or group. It's something you learn.
And while the 'us and them' mentality is strong, it isn't insurmountable either. It can be made weaker or stronger...
Anyway, it's the whole nature VS nurture argument academics have only been having for at least the last 200 years...
Current answer from researchers:
You are shaped by your environment, but your genes predispose you to certain things.
However, 'environment' is everything you've ever been exposed to. From the moment of conception. (or perhaps even before that, if you think about it...)
Well, anyway... I can't really add much more to it than that.