We investigated mental health and cognitive function in 195 community-dwelling adults aged 18 to 92 years (M = 46.64). We assessed several cognitive domains, including psychomotor, executive function, and episodic memory. We found a significant Age x Mental Health interaction in relation to within-person (WP) variability (trial-to-trial variability in reaction time performance) in a four-choice psychomotor task and a Stroop task, but not in relation to mean reaction time measures from those tasks. Poorer mental health was associated with greater WP variability in older adults. We did not find this effect in relation to memory. The findings suggest that measures of WP variability may be sensitive to relatively subtle effects associated with age and poor mental health, and that they provide valuable insights into cognitive function in old age.