The relationship between intestinal microbiota and cognitive function has been investigated as one of the major topics within the intestinal microbiota–gut–brain axis. Although an increasing number of studies have demonstrated an improvement in learning and memory when using probiotics or prebiotics, to date, there are no studies that target the cognitive flexibility observed in the early stages of several neuropsychiatric diseases, including dementia. We have recently developed a novel behavioral task using the touchscreen operant system to assess cognitive flexibility. We found that the disruption of the intestinal microbiota in mice induced a decline in cognitive flexibility. In the present study, we investigated the effects of treatments consisting ofBifidobacterium animalissubsp.lactisand arginine (Bifal + Arg), which promote the production of intestinal bacterial polyamine, on cognitive flexibility in the mouse model. Male C57BL6 mice orally treated with Bifal + Arg three times a week gradually decreased the 1st-choice incorrect diagonal rate with repeated reversals compared with the control group. Furthermore, in serial reversal phases, Bifal + Arg-treated mice shifted to the behavior of choosing a new correct spot more quickly after the reversal, and this was faster with repeated reversals. These results indicate that this treatment adapts to change and improves cognitive flexibility. This is the first report to show that intestinal environmental control, including probiotics and prebiotics, improves cognitive flexibility in mice.