Let $X$ be a subset of $C([0,1])$ with $$ X=\big\{f\in C([0,1]): 0\le f(x)\le x,\text{$f$ is a polynomial}\big\} $$ where $C([0,1])$ denotes the space of continuous real-valued functions on $[0,1]$. Define a nonlinear functional $F$ on $C([0,1])$ as $$ F(f)=\int_0^1 |f(x)|^2\; dx-\left(\int_0^1 f(x)\; dx\right)^2 $$ Can $F$ achieve a maximum in the set $X$?
Remarks.
If one restricts the set to the linear functions $f$ of the form $f(x)=kx$ with $0\le k\le 1$, then this reduces to a min/max problem for values of $k$: $$ F(f) = \int_0^1 (kx)^2\;dx-\left(\int_0^1kx\;dx\right)^2=\frac{k^2}{3}-\frac{k^2}{4} = \frac{k^2}{12} $$ So the maximum is achieved at $f(x)=x$ for the restriction.
One could also restrict the functions to be parabolas of the form $f(x)=kx^2$ with $k\in[0,1]$, and get $$ F(f)=\frac{k^2}{5}-\frac{k^2}{9}=\frac{4k^2}{45}, $$ where the maximum is achieved at $f(x)=x^2$.
If one allows one more parameter and consider $f(x)=kx^m$, then $$ F(f)=k^2\cdot \left(\frac{1}{2m+1}-\frac{1}{(m+1)^2}\right)=\frac{k^2m^2}{(2m+1)(m+1)^2}\;. $$ Then one can study the maximum of $g(m)=\frac{m^2}{(2m+1)(m+1)^2}$ over positive integers $m$.
But this is far from analyzing all the polynomials in $X$.
Another observation is that the functional can be written as $F(f)=\|f\|_{L^2}^2-\|f\|_{L^1}^2$. But this seems not helpful at all.
This question was motivated by this unanswered question on the site. I was curious and attempted to solve that one but I didn't get anything. So I restrict the attention to the set of polynomials here.