Find all functions $f: \mathbb{R} \to \mathbb{R}$ such that $f(f(x+y)) = f(x)+f(y)$ The problem is to find the set of all functions $f: \mathbb{R} \to \mathbb{R}$ such that for all $x,y \in \mathbb{R}$ we have $f(f(x+y)) = f(x)+f(y)$.  We first notice that $f(x)=x+c$ is a solution. With some work it turns out that it is enough to find solutions with $f(0)=0$ and from that to find all solutions, and moreover, it is not that hard to show that in this case of $f(0)=0$ the functional equation is equivilent to the two conditions: 
$$(1): f(x+y)=f(x)+f(y) \\ (2) :f(f(x))=f(x) $$
I was expecting that the only solutions will be $f(x) = x, f=0$ but with a bit more thought I think the set of solutions is bigger. I would like to know if I'm right. Here's what I thought: take a basis $\{e_\alpha\}_{\alpha \in I}$ of $\mathbb{R}$ as a vector space over $\mathbb{Q}$. Consider a division of this basis to disctint pairs $(e_\alpha, e_\beta)$ [each element of the basis appears in one and exactly one of those pairs). Define $f$ on the basis elements as $f(e_\alpha) = e_\beta, f(e_\beta)=e_\beta$. Thus we defined $f$ on the basis elements. Now, we simply continue $f$ linearly, to define it on all $\mathbb{R}$: $f(\sum a_i e_i) = \sum a_i f(e_i)$. This makes sure $(1)$ holds and $f$ is additive. By definition, it is trivial that $(2)$ also works if $x$ is a basis element,and therefore, because $f$ is additive, it also holds for any real number (just write it as a linear combination of the basis elements and do the algebra). Therefore I think this is a construction which shows that there are plenty of pathological solutions. Am I right? Is there a nice way to characterize all solutions?
 A: Your analysis is incomplete.
You misunderstood what is necessary for $ f(f(x)) = x$.
While having $f(e_\alpha) = e_\beta, f(e_\beta) = e_\alpha$ is a sufficient condition, it is not a necessary condition. For example, the solution $f(x) = 0 $ corresponds to mapping each basis element to 0.

The first condition tells us that with any basis $ \{e_\alpha\}$ of $ \mathbb{R}$ over $\mathbb{Q}$, if $ f( e_\alpha ) = f_\alpha$, then $ f(\sum a_\alpha e_\alpha) = \sum a_\alpha f_\alpha$.
The second condition tells us that the image of $f$ satisfies $ a \in $ Im $f \Rightarrow f(a) = a $.
So, the correct classification of solutions is:
Given any solution $f$,

*

*Let $ \{ e_\alpha\}$ be a $\mathbb{Q}$ basis for the image of $f$, then for every $a \in Im$  f, $ f(a ) = a$

*Let $\{e_\alpha\} \cup \{ f_\beta\}$ be a $\mathbb{Q}$ basis for $\mathbb{R}$. Then, $f( f_\beta) = \sum c_{\beta\alpha} e_\alpha$.

*Finally, if $ r = (\sum a_\alpha e_\alpha ) + (\sum b_\beta f_\beta)$, then $f(r) = (\sum a_\alpha e_\alpha )+ (\sum b_\beta c_{\beta\alpha} e_\alpha)$.

It is clear that any such solution satisfies the 2 conditions.
