I've been reading Tao's *An introduction to measure theory*,a draft can be found here.An exercise from it is

Exercise 30 (Rising sun inequality) Let ${f: {\bf R} \rightarrow {\bf R}}$ be an absolutely integrable function, and let ${f^*: {\bf R} \rightarrow {\bf R}}$ be the one-sided signed Hardy-Littlewood maximal function

$$\displaystyle f^*(x) := \sup_{h>0} \frac{1}{h} \int_{[x,x+h]} f(t)\ dt.$$

Establish the rising sun inequality

$$\displaystyle \lambda m( \{ f^*(x) > \lambda \} ) \leq \int_{x: f^*(x) > \lambda} f(x)\ dx$$

for all real ${\lambda}$ (note here that we permit ${\lambda}$ to be zero or negative).

I've prove it. But there it's another exercise after it

Exercise 31 Show that the left and right-hand sides in Exercise 30 are in fact equal when ${\lambda>0}$.

I tried to solve it and failed. And I found that if we take $f=1_{[0,1]}$, and $\lambda=\frac{1}{2}$ then the left-hand side is $\frac{1}{2}$ but the right-hand side is $1$, which are not equal.

Am I make any mistake? Please tell me.

Thanks in advance.