I don't know if you are aware of the Euler-Lagrange Identity, but that would solve this in one line. So for any integral of the form
$$J[f] = \int_{x_1}^{x_2} L(x,f(x), f'(x))dx$$
The minima or maxima will occur when $f$ satisfies the following differential equation
$$\frac{\partial L}{\partial f} - \frac{d}{dx}\frac{\partial L}{\partial f'} = 0$$
The derivation is quite well explained here, and should be easy enough to follow: https://en.wikipedia.org/wiki/Calculus_of_variations
So using this, with $L(x,f(x)) = x^2f(x) - xf^2(x)$,
$$\frac{\partial L}{\partial f} = x^2 - 2xf(x) = 0$$
Hence $f(x) = \frac{x}{2}$, and maximum value is $\frac{1}{16}$
Alternate Solution
Rewrite the integral as
$$I = \int_0^1x^3\left(\frac{f(x)}{x} - \left(\frac{f(x)}{x}\right)^2\right)dx$$
Let $\frac{f(x)}{x} = y(x)$
$$I = \int_0^1x^3y(1-y)dx$$
Now, tha maximum attainable value for $y(1-y)$ is when $y = \frac{1}{2}$
Hence, $$I \leq \int_0^1 \frac{x^3}{4}dx$$
With equality occuring only when $f(x) = \frac{x}{2}$
Best Answer
Let $f^+(x)=\max\{0,f(x)\},f^-(x)=\max\{0,-f(x)\},$ and assume $$A^+=\{x|f^+(x)>0\},A^-=\{x|f^-(x)>0\},$$then $A^+\cap A^- = \emptyset$ $$\int_{A^+}f^+(x)=\int_{A^-}f^-(x)=a$$for some $a\ge 0$ by $\int_{0}^{1}f(x)=0.$
We have that $$a \le m(A^+),$$and,$$a\le m(A^-).$$
We now want to find the maximum of $$\int_{0}^{1}f^3(x)=\int_{A^+}f^+(x)^3-\int_{A^-}f^-(x)^3$$
So we just need to find the maximum of $\int_{A^+}f^+(x)^3$, and the minimum of $\int_{A^-}f^-(x)^3$.
For the first term, we have $f^+(x)\le 1$,So $$f^+(x)^3\le f^+(x)$$ hence we have $$\int_{A^+}f^+(x)^3\le \int_{A^+}f^+(x) = a.$$ and for the second term we have $$\frac{\int_{A^-}f^-(x)^3}{m(A^-)}\ge \left(\frac{\int_{A^-}f^-(x)}{m(A^-)}\right)^3=\left(\frac{a}{m(A^-)}\right)^3$$(You can prove it by Hölder's inequality)
So we have $$ \int_{0}^{1}f^3(x)=\int_{A^+}f^+(x)^3-\int_{A^-}f^-(x)^3\le a-\frac{a^3}{m(A^-)^2}\le a-\frac{a^3}{(1-m(A^+))^2}\le a-\frac{a^3}{(1-a)^2} $$ Since $2a=\int_{A^-}f^-+\int_{A^+}f^+\le 1$, so $a\le 1/2.$ So by a simple computation $$a-\frac{a^3}{(1-a)^2}\le \frac{1}{4}\quad a\in[0,1/2].$$ When $a=\frac{1}{3}$, it equals to $\frac{1}{4}.$
To show $\int_{0}^{1}f(x)^3$ can attain $\frac{1}{4},$ consider such $f(x)$:$$f(x)=1,0\le x\le \frac{1}{3},f(x)=-\frac{1}{2},\frac{1}{3}<x\le 1. $$