Start from the molecule the brain uses to make us sleepy: adenosine.
The longer we stay awake, the more adenosine builds up in the brain as a by-product of energy (ATP) metabolism. By binding its A$_1$/A$_{2A}$ receptors, adenosine dampens the arousal-promoting networks and creates the rising "sleep pressure" we feel by night-time. In short, adenosine = the brake that promotes sleep.
Caffeine works by sitting on those same adenosine receptors as a competitive antagonist - it has a similar shape, occupies the receptor, but produces no effect. With adenosine blocked, its sleep-promoting brake is released, the arousal systems keep firing, and the person stays alert. That is the entire basis for caffeine-induced wakefulness, and it explains why an evening coffee leaves this patient unable to sleep (caffeine's half-life of several hours means a dose taken near bedtime is still active).
The other options misattribute the mechanism: caffeine does not chiefly work by switching on the locus coeruleus or by liberating histamine, and it is certainly not inert when taken an hour before bed.
Hence the correct choice is A - caffeine blocks adenosine and causes wakefulness.