TITLE: $\int_0^1 (f(x))^n =$ constant, $f\geq 0$, then $f$ is a characteristic function of a measurable set.
QUESTION [6 upvotes]: $\int_0^1 (f(x))^n =$ constant, $f\geq 0$, then $f$ is a characteristic function of a measurable set. This is the result from question part (a).
Now for part (b), will it also hold when the assumption $f\geq0$ is removed?
Here are my thoughts. Since the result from part (a) holds for $f^2 \geq 0$, then $f^2$ is a characteristic function of a measurable set. Now if $f$ takes the value $-1$ on a set of positive measure, $\int_0^1 (f(x))^n$ would not be constant for even and odd $n$. 
Is this correct? Thanks!

REPLY [3 votes]: Yes, that is correct. 
You could also use that
$$\int f^2 - f =0$$
by assumption, but (because $f^2$ is a characteristic function so that $f$ is of modulus one) $f^2 - f = |f|-f\geq 0$, which yields $|f| = f$ a.e., so that you can apply (a).