TITLE: 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)$
QUESTION [7 upvotes]: 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

REPLY [2 votes]: Using your results, we find that 
$$\tag1f(x+f(x+2y))=2x+2y+4\qquad\text{for }x,y\ge0 $$
In particular,
$$\tag2 f(x+f(x))=2x+4\qquad\text{for }x\ge0$$
Let $S=\{\,k\in\Bbb Z\mid f(2k)=2k+2\,\}$. You essentially showed that $k\in S\implies k+1\in S$ and hence from the given $0\in S$, we have $\Bbb N_0\subseteq S$.
With $x=-2y$ we have
$$ \tag3f(-2y+2)=f(-4y)+f(2y)\qquad\text{for }y\in\Bbb Z$$
Thus if two of $1-y,-2y,y$ are in $S$, then tso is the third.
In particular, for $y<0$ we already known $1-x,-2y\in S$; we conclude 
$S=\Bbb Z$, i.e.,
$$\tag4f(x)=x+2\qquad \text{for }x\in2\Bbb Z$$
and hence
$$\tag{1'}f(x+f(x+2y))=2x+2y+4\qquad\text{for }x,y\in\Bbb Z $$
and in particular
$$\tag{2'} f(x+f(x))=2x+4\qquad\text{for }x\in\Bbb Z$$
Assume that for some odd $x=2n+1$ the value $f(x)=2m$ is even.
Then for $k\in\Bbb Z$
$$\begin{align}f(1+2k)&=f\bigl(1+2(k-m)+f(2n+1)\bigr)\\
&=f\Bigl((1+2k-2m)+f\bigl((1+2k-2m)+2(n-k+m)\bigr)\Bigr)\\
&= 2(1+2k-2m)+2(n-k+m)+4\\
&=6+2k-2m+2n\end{align}$$
and so with the odd constant $c:=2n-2m+5$ 
$$f(x)=x+c\qquad\text{for }x\in 2\Bbb Z+1$$
Then $6=f(1+f(1))=f(2+c)=2+2c$ implies $c=2$, contradicting that $c$ is odd.
Therefore $f(x)$ is odd for all odd $x$. But then $x+f(x)$ is even and from $(4)$, we get $2x+4=f(x+f(x))=x+f(x)+2$ and so
$$f(x)=x+2 $$