Find all solutions to $f(x+f(x))=2x$
Here is an odd example of your functional equation, which is additive (that is, $f(x+y)=f(x)+f(y)$ for all $x,y\in\mathbb{R}$) but not of the form $f(x)=kx$.
Let $B$ be a Hamel basis of $\mathbb{R}$ over $\overline{\mathbb{Q}}$; that is, we will regard $\mathbb{R}$ as a vector space over the algebraic closure of $\mathbb{Q}$. It is known that we can decompose $B=B_0\cup B_1$ into disjoint linearly independent sets with same cardinailty. That is, we can find an index set $I$ such that $$B_0 = \{a_i :i\in I\}\text{ and } B_1 =\{c_i : i\in I\}.$$
We will define $f$ over whole $\mathbb{R}$ via defining it over a basis. Take $$f(a_i) = -\frac{1}{2}a_i+\frac{\sqrt{5}}{2}c_i \quad\text{ and }\quad f(c_i) = \frac{\sqrt{5}}{2}a_i-\frac{1}{2}c_i.$$ We can see that $f(f(b))+f(b) = 2b$ for all $b\in B$, hence $f(f(x))+f(x)=2x$ for any $x\in\mathbb{R}$.
If $f(x) = kx$ for some $k\in\mathbb{R}$, then $k$ must be 0 or 2. Moreover, $(k-1)a_i-c_i=0$ for any $i$. However it is not possible as $\{a_i,c_i\}$ is linearly independent.
We can show that $f(x) = x$ and $f(x) = -2x$ are the only continuous solutions. We begin by explicitly mentioning this assumption.
Assumption. $f : \mathbb{R} \to \mathbb{R}$ is a continuous function that solves the functional equation
$$ \forall x \in \mathbb{R} \ : \quad f(x+f(x)) = 2x. $$
The idea is to consider the function $m(x) = f(x)/x$ on $\mathbb{R}\setminus\{0\}$. To investigate the property of this function, we show the following lemma.
Lemma. Let $f$ be as in the assumption. Then
- $f(x) = 0$ if and only if $x = 0$.
- $f(x) = -x$ if and only if $x = 0$.
Proof. If $f(x) = 0$, then $0 = f(x) = f(x+f(x)) = 2x$ and hence $x = 0$. For the other direction, notice that $f(f(0)) = 0$. So by the previous step, we find that $f(0) = 0$.
Now assume that $f(x) = -x$. Then $2x = f(x+f(x)) = f(0) = 0$ and hence $x = 0$. The other direction is clear from the previous step. ////
From this lemma, we know that $m(x) \notin \{-1, 0\}$ for all $x \in \mathbb{R}\setminus\{0\}$. Since $m$ is continuous, either $m(x) > 0$ for all $x > 0$ or $m(x) < 0$ for all $x > 0$.
Case 1. Assume that $m(x) > 0$ for all $x > 0$. This means that $f(x) > 0$ for all $x > 0$. Since $f$ is surjective, this implies that $f(x) < 0$ for some $x < 0$, then by the same argument, we find that $m(x) > 0$ for all $x \in \mathbb{R}\setminus\{0\}$.
Now notice that $m$ solves the following functional equation
$$ \forall x \in \mathbb{R}\setminus\{0\} \ : \quad m(x+f(x)) = \phi(m(x)), \qquad \phi(a) = \frac{2}{1+a}. \tag{*} $$
By the surjectivity and continuity of $f$, we easily check that $\{x+f(x):x \neq 0\} = \mathbb{R}\setminus\{0\}$. So by $\text{(*)}$, we know that $\mathsf{Ran}(m) := \{ m(x) : x \in \mathbb{R} \setminus\{0\} \}$ satisfies $\mathsf{Ran}(m) \subseteq \mathsf{Ran}(\phi\circ m)$.
Now, if $\mathsf{Ran}(m) \subseteq (a, b)$ for some $a, b \in [0, \infty]$, then $\mathsf{Ran}(m) \subseteq (\phi(b), \phi(a))$ holds as well. Then starting from $\mathsf{Ran}(m) \subseteq (0, \infty)$ and iterating the previous observation, we have
$$\mathsf{Ran}(m) \subseteq (\phi^{\circ(2n)}(0), \phi^{\circ(2n)}(\infty))$$
and by letting $n\to\infty$ shows that $\mathsf{Ran}(m) \subseteq \{1\}$. Therefore $f(x) = x$.
Case 2. Assume that $m(x) < 0$ for all $x > 0$. The proof in this case will be quite similar as in the previous case, so we will skip some details.
Again, we easily find that $m(x) < 0$ for all $x < 0$ as well. Now rewriting $\text{(*)}$ as
$$ m(x) = \psi(m(x+f(x))), \qquad \psi(a) = \frac{2}{a} - 1 $$
we find that $\mathsf{Ran}(m) \subseteq \mathsf{Ran}(\psi \circ m)$. Starting from $\mathsf{Ran}(m) \subseteq (-\infty, 0)$ and iterating this relation, we easily find that
$$ \mathsf{Ran}(m) \subseteq (\psi^{\circ(2n)}(-\infty), \psi^{\circ(2n)}(-1)) $$
Letting $n\to\infty$ shows that $\mathsf{Ran}(m) \subseteq \{-2\}$, from which it follows that $f(x) = -2x$.