First of all, racism is downplayed in the novel. Sexism is much more prevalent. The exception is Sophia's run-in with the Mayor and his wife, Miss Millie.
Few of the characters in the novel have contacts with whites. Sophia is the only dynamic character to do so. She is a foil to Celie: whereas Celie is passive, Sophia is aggressive. Whereas Celie plays a subservient, submissive role in her marriage, Sophia play a dominant role. So, within marriage and the black community, we see Sophia as a strong, modern feminist--or, as Alice Walker prefers--a womanist.
Sophia tries to extend this role into white society. As dominant as she thinks she is within her marriage and the black community, Sophia soon realizes that she is no better than a maid in the white community.
First, Sophia is beaten excessively because she strikes a white man. Then, she is victimized by the legal system which keeps her imprisoned excessively, away from her family. Then, as part of her parole, she must become the victim's wife's mail. This is an absurd scenario, akin to slavery.
Miss Millie, though not an extroverted racist, is racist nonetheless because she stereotypes and condescends toward the black community. She says, "I've always been good to you people." This shows the most pervasive form of white-against-black racism: the belief that it's the white's duty to help an inferior race.
In "The Color Purple" Sophia is a strong willed and outspoken black woman. One day she goes to town with her children. While in town the mayor's wife inspects her child. She asks her if she would like to be her maid. Sofia intervenes telling the woman, "Hell no!" The mayor slaps her and Sofia hits him back. They decide to put her in her place. She is beaten so badly. Her face swells and is the color purple. Sofia is put in jail. After she is released she is assigned to live and care for the mayor's wife. By the time Sofia is released from her duties, she is older and her children have grown.
Sofia's youth has been lost because of her defiance of a racist statement that she chose to advocate against.