let p be (t,t^2)
Area OPQ=\int_{0}^{t^2}{\sqrt{y}-\frac{y}{2}dy}
Area OPR=\int_{0}^{t}{x^2-f(x)dx}
these two areas are equal.
or \int_{0}^{t^2}{\sqrt{y}-\frac{y}{2}dy}=\int_{0}^{t}{x^2-f(x)dx}
Now differentiate both sides wrt t:
\left(t-\frac{t^2}{2} \right)2t=t^2-f(t)
or,f(t)=t^3-t^2
assumed that the function is cont in the int (0,1)
