What can be said about a complex valued, continuous function $f$, defined on $[0,1]$, such that: $$ \int_0^1{|f|^2}=\left|\int_0^1{f}\right|^2 $$ I encountered this form as part of an exercise. Obviously, the above holds for any constant $f$, and it seems intuitive that the converse also holds (i.e. that if the above equality is true, then $f$ is constant), but I could not prove it.
Any help will be appreciated.