How does the brain's energy consumption depend on mental activity?
The energy consumption doesn't vary that much between resting and performing tasks, as discussed in a review by Marcus Raichle and Mark A. Mintun:

In the average adult human, the brain represents approximately 2% of
the total body weight but approximately 20% of the energy consumed
(Clark &amp; Sokoloff 1999), 10 times that predicted by its weight alone.
Relative to this high rate of ongoing or “basal” metabolism (usually
measured while resting quietly awake with eyes closed), the amount
dedicated to task-evoked regional imaging signals is remarkably small.
The regional increases in absolute blood flow associated with imaging
signals as measured with PET are rarely more than 5%–10% of the
resting blood flow of the brain. These are modest modulations in
ongoing circulatory activity that rarely affect the overall rate of
brain blood flow during even the most arousing perceptual and vigorous
motor activity (Fox et al. 1987, Friston et al. 1990, Lennox 1931,
Madsen et al. 1995, Roland et al. 1987, Sokoloff et al. 1955).
[...]
From knowledge of these relationships, one can estimate that if blood flow and glucose utilization increase by 10%, but oxygen consumption does not, the local energy consumption increase owing to a typical task-related response could be as little as 1%. It becomes clear, then, that the brain continuously expends a considerable amount of energy even in the absence of a particular task (i.e., when a subject is awake and at rest).

Techniques like fMRI measure relatively small differences, their existence does not contradict the claim that the energy consumption of the brain doesn't change a lot between the resting state and performing an activity.

1. Raichle ME, Mintun MA. BRAIN WORK AND BRAIN IMAGING. Annual Review of Neuroscience 2006 Jul;29(1):449-476.