I need some help solving this problem:
Let $(X,\mathcal{M},\mu)$ be a measure space and $f:X\mapsto[0,\infty]$ be a $\mu-$measurable function such that there exists $C\geq0$ such that $$\int_X(f(x))^nd\mu(x)=C,\;\text{for each }n\geq1$$I'm asked to show that there exist a measurable set $E$ such that $f=\chi_E$ almost everywhere.
My idea was to show that the sets $A=\{x\in X|f(x)>1\}$ and $B=\{x\in X|f(x)\in(0,1)\}$ have measure 0, so the function only takes values 0 and 1 a.e. and then I could take $E=f^{-1}(1)$ which will be measurable because $f$ is measurable and $f=\chi_E$ a.e.
We're told to use Fatou's lemma but I'm a bit lost. I think that we can say that $\mu(A)=0$ because for each $x\in A$ the sequence $(f(x)^n)$ is not bounded so the integral cannot be finite. And $\mu(B)=0$ because for $x\in B$$(f(x)^n)$ tends to 0 so the function would be end up being 0 in $B$ because $f\geq 0$. But I don't know if it is a good start and how to prove it rigorously. Any hint?
Thanks for your help.