TITLE: Calculating value of function at middle of interval, given integrals of the function on the interval.
QUESTION [12 upvotes]: I was asked the following question :

$$I = \int_0^1 xf(x) \,dx =\frac{1}{6}$$
$$J = \int_0^1 (f(x))^2\,dx =\frac{1}{12}$$
$$f\left(\frac{1}{2}\right) = \ ? $$
Here, $f(x)$ is a continuous function

My try: 
I couldn't find a good starting point to solve the function. Firstly I tried to draw some graphs of a random function $xf(x)$ and $2(f(x))^2$ so that the area under the two curves is the same, but it didn't reach any conclusive point. Next, I tried using : 
$$\int_0^{2a} f(x)\,dx = \int_0^a f(x) + f(a-x)\,dx$$
to get $\frac{1}{2}$ as one of the limits, but that just complicated things more, as I cannot comment much about $f(1-x)$. 
Any help would be appreciated. Thanks.
EDIT: It is given that the function is continuous.

REPLY [13 votes]: Compute $t \in \mathbb R$ such that
$$\int_0^1(f(x)-tx)^2 dx=0.$$
Since $f$ is continuous, we get $f(x)=tx.$