Let $ f $ be a nonnegative Lebesgue-measurable function on $ [0,1] $. Suppose that $ f $ is bounded above by $ 1 $ and that $ \displaystyle \int_{[0,1]} f = 1 $.
Problem. Show that $ f(x) = 1 $ almost everywhere on $ [0,1] $.
I don’t know how to start. Would it help to represent $ f $ as the pointwise limit of a sequence $ (f_{n})_{n \in \Bbb{N}} $ of simple functions on $ [0,1] $?
Let $X=[0,1]$. Consider $1-f$. If $f\ne 1$ a.e. then $1-f\ne 0 $ a.e. and indeed there is a positive measure set, $E$ so that $1-f>0$ on $E$. But then
$$0=1-1=\int_X 1-\int_X f=\int_X(1-f)=\int_E (1-f)>0.$$