If $\int_{ \mathbb{R} } f^{2n} d \lambda = \int_{ \mathbb{R} } f d \lambda $ then $\lambda (f^{-1}((1,\infty)))=0$ Consider the measure space $(\mathbb{R}, B( \mathbb{R}), \lambda)$, where $B( \mathbb{R}) $ denotes the Borel $\sigma$-algebra and $\lambda$ denotes the Lebesgue measure.
a) Let $f\in L^1$ be a function with values in $ [0,1]$ such that
$$\int_{ \mathbb{R} } f^2 d \lambda = \int_{ \mathbb{R} } f d \lambda . $$
Show that there exists a borel set $B$ of finite measure such that $f$ is the characteristic function almost everywhere.
b) Let $f\in L^1$ be a positive function such that $\forall n \geq 1$
$$\int_{ \mathbb{R} } f^{2n} d \lambda = \int_{ \mathbb{R} } f d \lambda . $$
1) Show that $\forall \alpha >0,$ $\lambda (f^{-1}([1+ \alpha ,\infty)))=0$.
2) Show that $\lambda(f^{-1}((1,\infty)))=0$.
3) What can we conclude about $f$?
I have already done part a) of this problem, since we can choose $B=supp(f)$. Also, part b) 2) follows from part b)1) by monotony and $\sigma$-subadditivity since we have that $(1,\infty)=\bigcup_{n\in \mathbb{N}}[1+\frac{1}{n} , \infty)$.
Also, what we can conclude about $f$, I believe, it's that from b)2) we would have that the set of elements such that the image belongs to $(1,\infty)$ has measure $0$, so we could apply part a) again and that condition will hold again, so $f$ can be seen almost everywhere again as a characteristic function in a borel set of finite measure.
If that is correct, my only trouble would be proving part b)1), and here I don't really know what to do, so any hint would be very appreciated. Thank you!
 A: Hint : Let $A= f^{-1}([1+\alpha, \infty ))$. Then $\int_A f^{2n} \mathrm{d}\lambda \leq \int_\mathbb{R} f\mathrm{d}\lambda$.
But also $\int_Af^{2n} \mathrm{d}\lambda \geq (1+\alpha)^{2n} \lambda(A)$
A: a) First observe that,
$$0\le f\le 1 \implies f(1-f)\ge 0$$
Then this yields
 $$\int_{ \mathbb{R} } f^2 d \lambda = \int_{ \mathbb{R} } f d \lambda \implies  \int_{ \mathbb{R} } f(1-f)d\lambda = 0 \implies f(1-f) = 0~~~a.e$$
Therefore there exists $N$ a Borel set such that, $\lambda(N) = 0 $ and 
$$f(x)(1-f(x)) = 0~~~~\forall ~~x\in\Bbb R\setminus N$$
Then set 
$$A= \{x\in\Bbb  R\setminus N:  f(x) = 1\} $$
then we have 
$$A^c= \{x\in\Bbb  R\setminus N:  f(x) = 0\}\cup N $$
Then see that 


*

*A is a Borel set since $f$ is measurable.

*if $x\in A$ we have $f(x) = 1$

*if $x\in A^c$ then we have $f(x) = 0 $ or $x\in N$ but  $\lambda(N) = 0 $
Hence, 
$$ f(x)= \chi_A(x) ~\text{for all}~\in  R\setminus N ~and ~~\lambda(N) = 0 \\\Longleftrightarrow f(x)= \chi_A(x) ~~\text{almost everywhere}$$
We also have,
$$0\le \lambda(A) =\int_A d\lambda = \int_A 1 d\lambda+\int_{A^c} 0d\lambda+\int_N fd\lambda =\int_\Bbb R fd\lambda <\infty.$$


Since $f = 0~~a.e$ on $A^c$  $\lambda(N) = 0$ implies $\int_N fd\lambda = 0$.

Conclusion $f$ is the characteristic function of Borel set 
  $$  f(x)= \chi_A(x) ~~\text{almost everywhere and}~~~\lambda(A) =\int_\Bbb R fd\lambda <\infty$$
  since $f\in L^1,~~~with ~~~f\ge 0$

b) Setting $A_k= f^{-1}([1+\frac1k, \infty ))$ and $A= f^{-1}([1, \infty ))$ we have 
$$A= \bigcup_{k=0}^{\infty} A_k$$
and and since $ f\ge 1\frac1k$ on $A_k$ we have, 
$$ (1+\frac1k)^{2n} \lambda(A_k)  =\int_{A_k}(1+\frac1k)^{2n} d\lambda \le \int_{A_k} f^{2n} d\lambda \le \int_\Bbb R f^{2n} \mathrm{d} = \int_\mathbb{R} f\mathrm{d}\lambda.~~~\forall ~n\ge  1$$
that is $$  \lambda(A_k)  \le(1+\frac1k)^{-2n}\int_\mathbb{R} f\mathrm{d}\lambda.~~~\forall ~n\ge  1$$
But since $f\in L^1,~~f\ge 0$, 
$$\int_\mathbb{R} f\mathrm{d}\lambda<\infty$$
Hence $$\lambda(A_k)  \le\lim_{n\to\infty}(1+\frac1k)^{-2n}\int_\mathbb{R} f\mathrm{d}\lambda. = 0 $$
Hence $$\lambda(A_k)= 0~~~\forall ~~k>1~,\implies \lambda(A) =0 $$
Thus, (1) and (2) are solve.
for question 3., for all $n\ge 1, $
$$\int_{ \mathbb{R} } f^{2n} d \lambda = \int_{ \mathbb{R} } f d \lambda \implies \int_{ \mathbb{R} } f^{2n-1} (1- f )d \lambda  = 0 .$$ Then ,
$$ 0=\int_{ \mathbb{R} } f^{2n-1} (1- f )d \lambda =\int_{ A } f^{2n-1} (1- f )d \lambda  +\int_{ A^c } f^{2n-1} (1- f )d \lambda.   $$
But since $\lambda(A)= 0$ and on A $1-f\le 0 $ we have, 
$$\int_{ A } f^{2n-1} (1- f )d \lambda = 0 \implies \text{for n=1}~~f(1-f) = 0~~a.e~~on ~~A $$
and also on $A$ we have  $1-f\ge  0 $ along with 
$$\int_{ A } f^{2n-1} (1- f )d \lambda = 0$$
yield 
$$ 0=\int_{ \mathbb{R} } f^{2n-1} (1- f )d \lambda =\int_{ A } f^{2n-1} (1- f )d \lambda  +\int_{ A^c } f^{2n-1} (1- f )d \lambda\implies   \int_{ A^c } f^{2n-1} (1- f )d \lambda\ =0\\implies~~for~~ f(1-f)=0~~~a.e ~~~ ~~on~~~A^c$$

Conlsuion $f(1-f) = 0~~a.e~~on ~~A $ and $f(1-f) = 0~~a.e~~on ~~A^c $ means that  $$f(1-f) = 0~~a.e~~~on~~\Bbb R.$$
  Similar reasoning as in the first part a) shows that $f$ is the characteristic function of a Borel set with finite measure.

