Let the function f is such that for every x,y∈R it is fulfilled the equation (1).
If in (1) we put y=x, we obtain
f(x+f(x))=2x, for every x∈R.(2)
Furthermore, for x=0 from (2) follows f(f(0))=0, and for x=y=2f(0) from (1) we obtain f(f(0))=f(0). Now, from the last two equations it follows that f(0)=0.
Now, if in (1) we put y=0 and if we use f(0)=0, we obtain
f(max{x,0}+min{f(x),0})=x, for every x∈R.(3)
We will consider two cases:
Case 1. x>0. Then from (3) it follows
f(x+min{f(x),0})=x.
From the last equality follows that or f(x+f(x))=x or f(x)=x. If f(x+f(x))=x, then for (2) it follows 2x=x, which is not possible when x>0. Hence, f(x)=x.
**Case 2∘** x<0. Then from (3) it follows
f(min{f(x),0})=x.
Now, from the last equality we obtain or f(0)=x or f(f(x))=x. If f(0)=x, then 0>x=f(0)=0, which is a contradiction. Hence, f(f(x))=x. Now, if in (2) instead of x we put f(x) and if first we use that f(f(x))=x, and after that we use the equality (2), we obtain
2f(x)=f(f(x)+f(f(x)))=f(f(x)+x)=2x,
from where we obtain f(x)=x, for x<0.
Finally, 1∘ and 2∘ implies that f(x)=x for every x∈R. It is not difficult to check that this function is a solution of the problem.