We investigated the associations of lifetime and everyday discrimination with cognitive function. Data were from the Chicago Community Adult Health Study (n=2952, mean age=43 years [SD=17]). We fitted multivariable linear regression models to quantify the discrimination-cognition associations. Major lifetime (β1 vs 0 episodes of discrimination = 0.56; 95% CI, 0.15-0.96; β2+ vs 0 episodes of discrimination = 0.64, 95% CI, 0.31-0.97) and everyday (β=0.10, 95% CI, 0.06-0.14) discrimination were positively associated with cognition, and these associations did not differ by race/ethnicity. Among older adults, major lifetime discrimination, but not everyday discrimination, was positively associated with cognition (β2+ vs 0 episodes of discrimination =1.79; 95% CI, 0.79-2.79). Measurement and selection bias may partially explain the counterintuitive study findings. We call for longitudinal research to further investigate the discrimination-cognition relationship.