Find all functions $f:\mathbb Z \rightarrow \mathbb Z$ such that $f(0)=2$ and $$f\left(x+f(x+2y)\right)=f(2x)+f(2y)$$ for all $x \in \mathbb Z$ and $y \in \mathbb Z$
My work so far:
1) $x=0$ $$f\left(f(2y)\right)=f(2y)+2$$
2) $y=0$ $$f\left(x+f(x)\right)=f(2x)+2$$
3) Let $n\ge 0$. Use induction we have
If $f(2n)=2n+2$ then $$f(f(2n))=f(2n+2)=2n+2+2=2n+4$$ Hence, if $k=2m\ge0$ then $f(k)=k+2$
4) $n<0$
I need help here
Supposing that we already know that $f(2n) = 2n + 2$ for $n \geq 0$, we can proceed as follows.
For some positive integer $k$, let $x = 2k$ and $y = -k$ in the functional equation. We get that $$ f(2k + 2) = f( 2k + f(2k - 2k) ) = f(4k) + f(-2k). $$
Now $2k + 2$ and $4k$ are positive even integers, and so this tells us that $$ 2k + 4 = 4k + 2 + f(-2k), $$ and hence $$ f(-2k) = -2k + 2. $$
Thus $f(2n) = 2n + 2$ holds for all integers $n$.
We know show that $f$ sends odd integers to odd integers. Suppose to the contrary that there are some integers $a$ and $b$ such that $$ f(2a - 1) = 2b. $$
Take $x = -1$ in the functional equation to get that for any integer $y$, that $$ f(f(2y - 1) - 1) = f(-2) + f(2y) = 2y + 2. $$
This gives us that $$ \begin{align*} f(2a - 1) & = 2b & f(2b - 1) & = f(f(2a - 1) - 1) = 2a + 2 \\ f(2a + 1) & = f(f(2b - 1) - 1) = 2b + 2 & f(2b + 1) & = f(f(2(a+1)-1)-1) = 2a + 4 \\ f(2a + 3) & = f(f(2(b+1)-1)-1) = 2b + 4 & f(2b + 3) & = f(f(2(a+2)-1)-1) = 2a + 6 \\ & \vdots & & \vdots \end{align*} $$ and inductively, we obtain that for every non-negative integer $k$, we have that $$ f(2a + 2k - 1) = 2b + 2k \quad\text{ and }\quad f(2b + 2k - 1) = 2a + 2k + 2. $$
Now suppose that $b \leq a$. Then there is some $k \geq 0$ such that $a = b + k$, which gives us that $$ 2b = f(2a - 1) = f(2b + 2k - 1) = 2a + 2k + 2 = 2b + 4k + 2, $$ which implies that $4k + 2 = 0$, a contradiction. Similarly, if $b > a$, then there is some $k \geq 0$ such that $b = a + k$. We then obtain that $$ 2a + 2 = f(2b - 1) = f(2a + 2k - 1) = 2b + 2k = 2a + 4k, $$ which gives us that $4k = 2$, again a contradiction.
We conclude that $f(2y - 1)$ is odd for every integer $y$. Thus for every integer $y$, we have that $f(2y - 1) - 1$ is even, and hence we have that $$ 2y + 2 = f(f(2y - 1) - 1) = f(2y - 1) + 1 $$ and hence that $$ f(2y - 1) = 2y + 1 $$ for every integer $y$.
We see that $f(n) = n + 2$ for every integer $n$, and can verify that this does indeed solve the functional equation.