this is not a very rigorous solution but is good to see.

put x=0,y=0 to get f(0)=2.

the given condition becomes

.....(1)

note that the centroid of the triangle

with

is

.

**i am assuming that the curve does not change its concavity**(this is where it becomes non-rigorous but this may be established by putting y=x and then using second derivative test).

The centroid of the triangle is inside the triangle but from (1) the centroid is on the curve Y=f(X) and hence outside ot on the triangle .... to see this draw a curve which is concave downwards and mark the three points OAB(this part is also non-rigorous)

so the curve of 'f' has to be a straight line.

put f(X)=aX+b and use f'(2)=2.