Set Eλ={x∣f(x)>λ}. By continuity of f, Eλ=f−1((λ,∞)) is open, so we can write
Eλ=n=1⋃∞(an,bn),
where the (an,bn) are pairwise disjoint. On [an,bn], f attains its minimum by continuity and satisfies
λ≤x∈Eλminf(x)≤x∈[an,bn]minf(x),
so we have for all n≥1 that
∫anbnf(x)−λdx≤21∣bn−an∣.
By countable additivity of the Lebesgue measure, adding these up gives
∫Eλf(x)−λdx≤21∣Eλ∣.
Notice that
∫Eλf(x)−λdx=∫Eλ+1f(x)−λdx+∫{x∣λ<f(x)≤λ+1}f(x)−λdx≥∫Eλ+1(λ+1)−λdx+∫x∣λ<f(x)≤λ+1λ−λdx=∣Eλ+1∣.
Thus,
∣Eλ+1∣≤21∣Eλ∣,
which was what we wanted to show.