Find $\int_{0}^{1} f(x)^3\:dx$
Hint :
$$ \int_0^1 \left\{f(x)-6x+2 \right\}^2dx = 0$$
Let me give you a deductive solution by linear algebra.
Define $$\begin{align}\langle h_1,h_2\rangle&=\int_{0}^{1}h_1(x)h_2(x)dx\\\|h\|^2&=(h,h)\end{align}$$
The information that is given is that $$\begin{align}\langle 1,f\rangle&=1\\\langle x,f\rangle&=1\\\langle f,f\rangle&=4\end{align}$$
Let's orthonormalize the system $1,x$. This is, we keep $f_1(x)=1$ and translate $x$ by a multiple of $f_1$ to get a function $f_2$ such that $\langle f_1,f_2\rangle=0$ and $\|f_2\|=1$.
We need that $0=(1,x+a)=\int_{0}^{1}(x+a)dx=\frac{1}{2}+a$. Therefore, $a=-\frac{1}{2}$.
Now, $\langle x-1/2,x-1/2\rangle=\frac{1}{12}$.
Therefore, $f_1(x)=1,f_2(x)=2\sqrt{3}\left(x-\frac{1}{2}\right)$ is orthonormal.
Note that $\langle f_2,f\rangle=\sqrt{12}\left(\langle x,f\rangle-\frac{1}{2}\langle 1,f\rangle\right)=\sqrt{3}$.
Then $\langle f,f\rangle=4=1^2+(\sqrt{3})^2=|\langle f_1,f\rangle|^2+|\langle f_2,f\rangle|^2$.
So, these functions satisfy the equality in Bessel's inequality.
We can now use the proof of Bessel's inequality
$$\begin{align}0&=\langle f,f\rangle -\langle f_1,f\rangle ^2-\langle f_2,f\rangle ^2\\ &=\langle f,f\rangle -2[\langle f_1,f\rangle ^2+\langle f_2,f\rangle ^2]+[\langle f_1,f\rangle ^2+\langle f_2,f\rangle ^2]\\ &=\|f-\langle f_1,f\rangle f_1-\langle f_2,f\rangle f_2\|^2\end{align}$$ to conclude that $f$ is $\langle f_1,f\rangle f_1-\langle f_2,f\rangle f_2$ almost everywhere and compute from it $\int_{0}^{1}f^3(x)dx$.
Of course, $\|f-\langle f_1,f\rangle f_1-\langle f_2,f\rangle f_2\|^2=0$ is the hint that you were given, since $$\langle f_1,f\rangle f_1+\langle f_2,f\rangle f_2=1+6x-3=6x-2,$$ and now you can see where it comes from.