It is readily checked that any affine function satisfies the condition in the statement. To prove the converse, set y=x to write
∫02xf(t)dt=x(f(2x)+f(0)).(∗)
Since f is integrable, (∗) shows that the function g:R→R, g(x)=x(f(2x)+f(0)), is continuous, so f is continuous on R∗=R∖{0}. Continuity of f on R∗ and (∗) then show g differentiable on R∗, so f is differentiable on R∗.
Differentiate (∗) to get 2f(2x)=f(2x)+f(0)+2xf′(2x); that is, xf′(x)−f(x)+f(0)=0 for all x=0. Consequently,
(xf(x)−f(0))′=0for all x=0,
so
f(x)={ax+f(0),bx+f(0),x<0,x>0.
Set now x=0 and y=1 in the relation in the statement to write
f(1)+f(−1)=∫−11f(t)dt=∫−10(at+f(0))dt+∫01(bt+f(0))dt=21(b−a)+2f(0).
Plug f(1)=b+f(0) and f(−1)=−a+f(0) into the above relation to get b−a+2f(0)=21(b−a)+2f(0), so a=b and f(x)=ax+f(0) for all real numbers x.
Alternative Solution:
For convenience, consider the integrable function g:R→R, g(x)=f(x)−f(0), along with the continuous function G:R→R, G(x)=∫0xg(t)dt. Clearly, g and G both vanish at the origin, and it is readily checked that
G(x+y)−G(x−y)=y(g(x+y)+g(x−y)),for all real numbers x and y.(1)
Let x=y=t/2 in (1), and recall that g and G both vanish at the origin, to infer that
2G(t)=tg(t),for all real numbers t.(2)
Next, let x=0 in (1) and use (2) to infer that G is an even function: G(−y)=G(y), for all real numbers y. With reference again to (2), it follows that g is odd: g(−y)=−g(y), for all real numbers y. It is therefore sufficient to focus on the restrictions g+ and G+ of g and G, respectively, to the ray of positive real numbers.
By (2), continuity of G+ implies that of g+ which in turn implies differentiability of G+ and G+′=g+.
Hence 2G+(t)=tG+′(t) for all real t>0, showing that the function t↦t−2G+(t), t>0, is constant; that is, G+(t)=αt2 for some real constant α, so g+(t)=at, where a=2α.
Consequently, g(t)=at for all real numbers t, and f(t)=at+f(0).