(covers information from several alternate timelines)
Racism is the belief that one race was inherently superior or inferior due to certain characteristics, be they physical (for example skin, eye, or hair color, or the genetic makeup of one's species) or cultural (such as a race's language, philosophy, religion, traditions, or level of technological development).
Racism on EarthEdit
The Ku Klux Klan, a white supremacist group, was notorious for it's anti-black, anti-Jewish, and anti-immigrant policies.
Benny Russell faced racism in 1950s New York City when he attempted to get his story published in Incredible Tales magazine, as it had a black captain in command of a space station. (DS9: "Far Beyond the Stars")
When Vic Fontaine's program was affected by the jack-in-the-box laid in it by programmer Felix, Benjamin Sisko admitted to Kasidy Yates that he eschewed the holo-program because he felt it ignored the suffering of African-Americans during the time period in which it was set. (DS9: "Badda-Bing, Badda-Bang")
The 23rd centuryEdit
In the 23rd century, the natives of the planet Cheron conducted a devastating war based solely on the racial differences of its inhabitants. While both races of their planet were half white and half black, the sides of their body which displayed those colors varied. As a result the ruling class, which was white on the left side and black on the right, suppressed the other race in which the coloration was reversed. By 2268, the racial campaign by the ruling class and rebellion by the oppressed had rendered the planet nearly uninhabitable. (TOS: "Let That Be Your Last Battlefield")
During the same century, as a result of his mixed Human/Vulcan heritage, Spock was the subject of constant discrimination, teasing, and ostracism during his youth by his full-Vulcan classmates, which apparently at least once descended into actual physical abuse; this could have been seen as racism. (TOS: "Journey to Babel"; TAS: "Yesteryear") This continued while Spock served on the USS Enterprise, during which Dr. Leonard McCoy referred to him, as, among other things: "pointy eared", "green blooded", and a "hobgoblin." This was done more due to McCoy's frustrations with Spock himself than any real dislike of the Vulcan people, and sometimes even as friendly jibes or even nicknames. While Spock generally appeared to be immune to the insults, one time Spock temporarily lost his emotional control and reacted with anger to McCoy's words, to the point of lifting McCoy up against the wall by his throat. (TOS: "All Our Yesterdays")
Spock also suffered this discrimination in the alternate reality, during which his classmates repeatedly cajoled him and insulted both him and his parents in order to elicit an emotional response from him. This culminated in an incident on the bullies' 35th attempt in the alternate 2243, when Spock viciously attacked the ringleader of the bullies after they referred to his father as a "traitor" and his mother as a "Human whore". Spock was also discriminated against by the selecting committee of the Vulcan Science Academy, who congratulated him on overcoming the "disadvantage" of his mixed heritage and gaining entry to the academy despite that disadvantage. Upon hearing this, Spock deferred entry - making him the first Vulcan to do so (told of this fact, he replied that, as he wasn't truly Vulcan, this statistic was unaffected by his decision) - sarcastically and bitterly giving the chairman the customary Vulcan farewell "Live long, and prosper." (Star Trek)
When the Enterprise encountered a Romulan Bird-of-Prey that had been attacking Federation outposts, several members of the crew, most notably Lieutenant Stiles, expressed prejudiced feelings toward Romulans, growing out of the war between the Federation and the Romulans. When visual contact was made with the Romulan ship and it was discovered that, visually, Vulcans and Romulans looked very much alike, Stiles began expressing strong skepticism and outright hatred towards Spock. His disdain for Spock went so far that Captain Kirk had to reprimand him for his bigotry. (TOS: "Balance of Terror")
As the result of a seventy-year Cold War between the Federation and the Klingon Empire, many Humans were heavily racist and prejudiced against Klingons in the late-23rd century, including high-ranking Starfleet officers, like Captain Kirk and Admiral Cartwright. (Star Trek VI: The Undiscovered Country)
The 24th centuryEdit
Racism still existed in the 24th century among some Humans and Vulcans as seen with Lieutenant Commander Christopher Hobson and his attitude toward his commanding officer Data. Hobson felt an android was unfit to be a captain and suggested that certain other species were not "meant" for certain assignments, such as a Klingon being a counselor. (TNG: "Redemption II") Vulcans who held racist attitudes included Captain Solok, who believed that Vulcan crews were superior to all others in Starfleet, that Vulcans were inherently superior to Humans and other "emotionally handicapped" species, and that Humans made "inefficient" and "unprofessional" officers. (DS9: "Take Me Out to the Holosuite")
Many races held strong racist views against each other, mostly reminiscent of previous hostilities. Klingons and Romulans were generally antagonistic to each other. Most Bajorans were heavily prejudiced towards Cardassians as a consequence of the Occupation. Cardassians often felt the same. Many Federation personnel, who fought in the war against them were also heavily against Cardassians, including Miles O'Brien. (TNG: "The Neutral Zone", "The Wounded"; DS9: "Duet", "Tears of the Prophets")