Suppose $f:[0,1]\to [0,1]$ is continuous and has the property $$\forall n\in\Bbb N\;\;\int_0^1f^n(x)\;dx=\int_0^1(f(x))^n\;dx$$ where $f^n=f\circ\cdots\circ f=f\circ f^{n-1}$ is the $n^{\text{th}}$ composition of $f$ on itself ; i.e. $f^1(x)=f(x), f^2(x)=f(f(x)),\dots$
Must $f$ be the zero function (or the constant function given by $f(x)=1$) ? Or might $f$ be a non-constant function ?