Increasing evidence has indicated that prebiotics as an alternative treatment for neuropsychiatric diseases. This study evaluated the prebiotics Fructooligosaccharides (FOS) and Galactooligosaccharides (GOS) on the modulation of neuroinflammation and cognition in an experimental model of mice high-fat diet fed. Initially, mice were distributed in the following groups: (A) control standard diet (n = 15) and (B) HFD for 18 weeks (n = 30). In the 13th week, the mice were later divided into the following experimental groups: (A) Control (n = 15); (B) HFD (n = 14); and (C) HFD + Prebiotics (n = 14). From the 13th week, the HFD + Prebiotics group received a high-fat diet and a combination of FOS and GOS. In the 18th week, all animals performed the T-maze and Barnes Maze, and were later euthanized. Biochemical and molecular analyzes were performed to assess neuroinflammation, neurogenesis, synaptic plasticity, and intestinal inflammation. Mice fed HFD had higher blood glucose, triglyceridemia, cholesterolemia, and higher serum IL-1β associated with impaired learning and memory. These obese mice also showed activation of microglia and astrocytes and significant immunoreactivity of neuroinflammatory and apoptosis markers, such as TNF-α, COX-2, and Caspase-3, in addition to lower expression of neurogenesis and synaptic plasticity markers, such as NeuN, KI-67, CREB-p, and BDNF. FOS and GOS treatment significantly improved the biochemistry profile and decreased serum IL-1β levels. Treatment with FOS and GOS also reduced TNF-α, COX-2, Caspase-3, Iba-1, and GFAP-positive cells in the dentate gyrus, decreasing neuroinflammation and neuronal death caused by chronic HFD consumption. In addition, FOS and GOS promoted synaptic plasticity by increasing NeuN, p-CREB, BDNF, and KI-67, restoring spatial learning ability and memory. Moreover, FOS and GOS on HFD modulated the insulin pathway, which was proved by up-regulating IRS/PI3K/AKT signaling pathway, followed by a decreasing Aβ plate and Tau phosphorylation. Furthermore, the prebiotic intervention reshaped the HFD-induced imbalanced gut microbiota by modulating the composition of the bacterial community, markedly increasing Bacteroidetes. In addition, prebiotics decreased intestinal inflammation and leaky gut. In conclusion, FOS and GOS significantly modulated the gut microbiota and IRS/PI3K/AKT signaling pathway, decreased neuroinflammation, and promoted neuroplasticity improving spatial learning and memory. Schematic summarizing of the pathways by FOS and GOS improves memory and learning through the gut-brain axis. FOS and GOS improve the microbial profile, reducing intestinal inflammation and leaky gut in the distal colon. Specifically, the administration of FOS and GOS decreases the expression of TLR4, TNF-α, IL-1β, and MMP9 and increases the expression of occludin and IL-10. Prebiotics inhibit neuroinflammation, neuronal apoptosis, and reactive gliosis in the hippocampus but restore synaptic plasticity, neuronal proliferation, and neurogenesis.