During evolution, individuals whose brains and bodies functioned well in a fasted state were successful in acquiring food, enabling their survival and reproduction. With fasting and extended exercise, liver glycogen stores are depleted and ketones are produced from adipose-cell-derived fatty acids. This metabolic switch in cellular fuel source is accompanied by cellular and molecular adaptations of neural networks in the brain that enhance their functionality and bolster their resistance to stress, injury and disease. Here, we consider how intermittent metabolic switching, repeating cycles of a metabolic challenge that induces ketosis (fasting and/or exercise) followed by a recovery period (eating, resting and sleeping), may optimize brain function and resilience throughout the lifespan, with a focus on the neuronal circuits involved in cognition and mood. Such metabolic switching impacts multiple signalling pathways that promote neuroplasticity and resistance of the brain to injury and disease.