Question: Let $f(x):[0,2] \to \mathbb{R}$ be a continuous function, satisfying the equation $$ \int_{0}^{2} f(x)(x-f(x)) \,dx = \frac{2}{3}. $$ Find $2f(1)$.
The solution took $f(x)=\frac {x}{2}$. Yes, I know it does not contradict the condition but how can we be sure that $f(x)=\frac{x}{2}$ and not any other function?
Note that $h(x):=f(x)-x/2$ is a continuous function in $[0,2]$ such that $$\int_0^2h(x)^2\,dx=-\int_{0}^{2} f(x)(x-f(x)) dx+\int_{0}^{2}x^2/4dx=-\frac{2}{3}+\frac{[x^3/3]_0^2}{4}=0.$$ What may we conclude?