5. Find a function $f: \mathbf{R} \rightarrow \mathbf{R}$ such that for any real numbers $x, y$ we have $f(f(x)+y)=2 x+f(f(y)-x)$.
(2003 Czech Training Problem, 2003 Chinese National Team Training Problem)
5. Let $y=-f(x)$, then $f(0)=2 x^{2}+f[f(-f(x))-x]$, i.e., $f(0)-2 x=f[f(-f(x))-x]$ holds for all $x$. Therefore, for any real number $f(0)-2 x=y$, there exists a real number $z$ such that $y=f(z)$, which means the function $f$ is surjective. Thus, there exists a real number $a$ such that $f(a)=0$. Let $x=a$, then the original functional equation becomes $f(y)=2 a+f[f(y)-a]$, i.e., $f(y)-a=f[f(y)-a]+a$. Since $f$ is surjective, for each real number $x$, there exists a real number $y$ such that $x=f(y)-a$, so, $x=f(x)+a$, i.e., $f(x)=x-a$ holds for all real numbers $x$. Upon verification, for any real number $a$, $f(x)=x-a$ satisfies the original functional equation.