The very fact that Crooks sleeps in separate quarters reveals racial discrimination as he is literally segregated from the other ranch workers. The moment when racial discrimination is most overtly revealed is at the end of Chapter 4 when Curley's wife confronts Crooks. Curley's wife invites herself into Crooks' room when he had already allowed Candy and Lennie in. Noting the danger of having her there, he asks her to leave. She refuses to leave (mostly out of loneliness but also somewhat meddling). Eventually, realizing this room is all he has, Crooks has had enough of Curley's wife pestering Lennie. He exclaims:
You got no rights comin' in a colored man's room. You got no rights messing around in here at all.
Curley's wife replies:
Well, you keep your place then, Nigger. I could get you strung up on a tree so easy it ain't even funny.
At this point, Crooks retreated in every way. He later tells Candy and Lennie that Curley's wife is right; that she could have him strung up. Recognizing it is her word against his, he realizes that he has no case. Crooks reluctantly acknowledges that he will be and has always been discriminated against because of the color of his skin. He resorts to backing down and replying, "Yes ma'am" to Curley's wife.
There is a parallel between Crooks and Lennie (and to some extent, Candy as well). Both Crooks and Lennie are social outcasts: Crooks because of his race and Lennie because of his awkward social behavior (Candy because of his old age). Crooks manages to fit in, albeit as a second-class citizen to the rest, while Lennie requires constant supervision from George in order to fit in.