Face masks, CO₂, and cognitive impairment
This post may be difficult to comprehend while wearing a face mask
The CDC recommends, and many places require, face masks, in an attempt to reduce the spread of COVID-19. Multiple studies find significant declines in cognitive performance at 1,000 to 1,500 ppm CO₂, a small fraction of the approximately 10,000 ppm associated with breathing through a face mask.
The interior air of KN95 masks contains about 2.5% or 25,000 ppm CO₂  and the inhaled average is about one half or one third of this time average .
A substantial volume of exhaled air with high CO₂ (about 36,000 ppm from the previous exhalation) is re-inhaled while wearing a face mask. For each adult breath, a volume of 500 ml is typically inhaled and exhaled. During inhalation, the mask-interior air volume of 100 ml  with high CO₂ mixes in a roughly 1-to-4 ratio with fresher air, leading to an inhaled concentration of approximately 7,500 ppm.
Going beyond this simple estimate, a detailed computational fluid dynamics study  modeled CO₂ in an N95 mask and found an inhaled average of 10,555 ppm. Cloth and surgical masks have the same basic geometry, and therefore similar CO₂ concentrations. Their filtration is less effective than N95 masks due to larger pore size and edge leakage, but they trap a similar exhaled volume for re-inhalation.
CO₂ concentrations above 1,000 ppm were seen to correlate with reduced cognitive performance  (in the following figure, up is worse).
A 2012 study  also found improved student performance with fresher air and describes a preferred CO₂ concentration of 1,000 ppm or below.
Finally, a double-blind study of twenty-four test subjects  repeatably found far higher scores for cognitive tasks at low levels CO₂.
We found statistically significant declines in cognitive function scores when CO₂ concentrations were increased to levels that are common in indoor spaces (approximately 950 ppm). In fact, this level of CO₂ is considered acceptable because it would satisfy ASHRAE’s ventilation rate guidance for acceptable indoor air quality. Larger differences were seen when CO₂ was raised to 1,400 ppm.
Update for Feb. 8, 2022: Contrary to the above studies, the US Navy, who routinely operate submarines with elevated CO₂, find no significant cognitive changes, even at 15,000 ppm.
A NASA study also found no effect at 5,000 ppm. These results conflict with references 5-7, which do find significant declines for 1,000 to 1,500 ppm.
Reference 7, the main study supporting CO₂ danger, has many authors from Harvard, a deeply anti-CO₂ institution. On the other hand, both the US Navy and NASA would face a huge burden to reduce CO₂ in their vessels. Institutional preferences correlate with study results.
Rhee, M.S.M., Lindquist, C.D., Silvestrini, M.T. et al. Carbon dioxide increases with face masks but remains below short-term NIOSH limits. BMC Infect Dis 21, 354 (2021).
Normal breathing in mammals consists of inhalation, exhalation, and a waiting period before the next breath. Therefore, the in-mask time-average (shown in the first figure) is dominated by exhaled air.
Birgersson E, Tang EH, Lee WLJ, Sak KJ (2015) Reduction of Carbon Dioxide in Filtering Facepiece Respirators with an Active-Venting System: A Computational Study. PLOS ONE 10(6): e0130306.
Hana Salati, Mehrdad Khamooshi, Sara Vahaji, Farid C. Christo, David F. Fletcher, and Kiao Inthavong, N95 respirator mask breathing leads to excessive carbon dioxide inhalation and reduced heat transfer in a human nasal cavity, Physics of Fluids 33, 081913 (2021)
Myhrvold, A.N., Olsen, E., Lauridsen, O. Indoor environment in schools - pupils health and performance in regard to CO₂ concentrations. Indoor Air, 1996
Zs. Bakó-Biró, D.J. Clements-Croome, N. Kochhar, H.B. Awbi, M.J. Williams,
Ventilation rates in schools and pupils’ performance, Building and Environment, Volume 48, 2012, Pages 215-223
Allen, Joseph G., Piers MacNaughton, Usha Satish, Suresh Santanam, Jose Vallarino, and John D. Spengler. 2016. Associations of Cognitive Function Scores with Carbon Dioxide, Ventilation, and Volatile Organic Compound Exposures in Office Workers: A Controlled Exposure Study of Green and Conventional Office Environments. Environmental Health Perspectives 124 (6): 805-812.
Note: A nifty gadget can monitor indoor CO₂ (I have no affiliation with Digi-Key or Sensiron).
Please keep comments on topic.