TITLE: Find all functions $f:\Bbb{R}\to \Bbb{R}$ such that $f$ is continuous and $ f(f(x+y)) = f(x)+f(y)$
QUESTION [6 upvotes]: Find all functions $f:\Bbb{R}\to \Bbb{R}$ such that $f$ is continuous
  and $ f(f(x+y)) = f(x)+f(y)$

My steps:
By inspection, $f(x)=x+c$ and $f(x)\equiv 0$ works, while $y=mx \,\,(m\neq1)$ and $y=mx+c\,\,(m\neq1)$ do not.
Setting $x=y=0$ gives $f(f(0))=2f(0)$
Setting $y=-x$ leads to
$f(f(0)) = 2f(0) = f(x)+f(-x) \implies f(0) = \frac{f(x)+f(-x)}{2}$
However I am stuck here. Any suggestions?

REPLY [10 votes]: Hint: Whenever $x+y=z+w$, we have $$f(x)+f(y)=f(f(x+y))=f(f(z+w))=f(z)+f(w).$$  Taking $g(x)=f(x)-f(0)$, see what you can deduce from this about $g$.
A full solution is hidden below.

 Subtracting $2f(0)$ from both sides of the equation above, we also have $$g(x)+g(y)=g(z)+g(w)$$ whenever $x+y=z+w$.  We also have $g(0)=0$.  So plugging in $w=0$ and $z=x+y$, we have $$g(x)+g(y)=g(x+y).$$  Since $g$ is continuous, this implies $g(x)=bx$ for some constant $b$.  We thus have $f(x)=bx+c$ for constants $b$ and $c$.  The functional equation then says $$b^2x+b^2y+bc+c=bx+by+2c$$ which implies $b^2=b$, so $b=0$ or $b=1$.  If $b=0$, we then must have $c=0$ so $f(x)=0$.  If $b=1$, we get $f(x)=x+c$ and this works for any $c$.