This study was conducted to evaluate the cognitive dysfunction improvement effect of aqueous extract of Codium fragile (AECF) by regulating the imbalance of the gut–brain axis in chronic particulate matter (PM)2.5-exposed mice. The physiological compounds of AECF were identified as hexadecanamide, oleamide, octadecanamide, stearidonic acid, and linolenic acid by the ultra-performance liquid chromatography-quadrupole time of flight mass spectrometry (UPLC Q-TOF MSE) analysis. To evaluate the effect of PM2.5 on the antioxidant system, superoxide dismutase (SOD) contents, reduced glutathione (GSH) contents, and malondialdehyde (MDA) contents were measured in colon and brain tissues. AECF significantly ameliorated the imbalance of the antioxidant systems. Also, AECF improved intestinal myeloperoxidase (MPO) activity, the abundance of the gut microbiome, short-chain fatty acids (SCFAs) contents, and tight junction protein expression against PM2.5-induced damage. In addition, AECF prevented PM2.5-induced inflammatory and apoptotic expression via the toll-like receptor-4 (TLR-4)/myeloid differentiation primary response 88 (MyD88) pathway in colon and brain tissues. Additionally, AECF enhanced the mitochondrial function, including the mitochondrial membrane potential (MMP) and reactive oxygen species (ROS) contents in brain tissues. Furthermore, AECF regulated the cholinergic system, such as acetylcholine (ACh) contents, acetylcholinesterase (AChE) activity, and protein expression levels of AChE and choline acetyltransferase (ChAT) in brain tissues. To evaluate the effect of cognitive dysfunction caused by PM2.5-induced intestinal dysfunction, behavior tests such as Y-maze, passive avoidance, and Morris water maze tests were performed. From the results of the behavior tests, AECF ameliorated spatial learning and memory, short-term memory, and long-term learning and memory function. This study confirmed that AECF reduced PM2.5-induced cognitive dysfunction by regulating gut microbiome and inflammation, apoptosis, and mitochondrial function by enhancing the gut–brain axis. Based on these results, this study suggests that AECF, which contains fatty acid amides, might be a potential material for ameliorating PM2.5-induced cognitive dysfunction via gut–brain axis improvement.