Find all continous functions $f:\mathbb{R}\to\mathbb{R}$ such that that for any real $x$ and $y$, $f(f(x+y))=f(x)+f(y)$.
My solution is, let $g(x)=f(x)-f(0)$ and $f(0)=a$. Then $$g(g(x+y)+a)=g(x)+g(y)+a\tag{*}$$ and $g(0)=0$. If we take $y=0$, $g(g(x)+a)=g(x)+a$. It means also $$g(g(x+y)+a)=g(x+y)+a.\tag{**}$$ Then $(*)$ becomes $$g(x)+g(y)+a=g(g(x+y)+a)=g(x+y)+a$$ Which implies $g(x)+g(y)=g(x+y)$ is Cauchy's FE on $\mathbb{R}$($f$ is continous) and from $(**)$, $g(x)=x$ . Therefore $\boxed{f(x)=x+a\quad\forall x, a\in\mathbb{R}}$. Is my solution correct?
Your answer is mostly correct.
You’ve ignored the case where $f(x)=0$ For all $x.$
We know from Cauchy that $g(x)=bx$ for some real $b.$ Then your equality $g(g(x)+a)=g(x)+a$ gives:
$$b^2x+ba=bx+a,$$ for all $x.$ So $b^2=b$ and $ba=a.$ If $b=0$ then $a=0.$ Otherwise $b=1.$
Also, you should verify that $f(x)=x+a$ works. That’s an easy step.