# How to solve $f(x+f(x)+2f(y))=f(2x)+f(2y)$?

Another functional equation:

Find all surjective functions $f:\mathbb R\to\mathbb R$ such that for all $x,y\in\mathbb R$ it satisfies: $$f(x+f(x)+2f(y))=f(2x)+f(2y)$$ I couldn't make any progress because I didn't know how to use the surjectivity. How to solve it?

Let $P(x,y)$ be the assertion $f(x+f(x)+2f(y))=f(2x)+f(2y)$ and let $a\in\mathbb R$ be such that $f(a)=0$. $$P(a,a):\space f(2a)=0\\ P(a,y):\space f(2f(y)+a)=f(2y)\implies\\ P(x,y):\space f(x+f(x)+2f(y))=f(2x)+f(2f(y)+a)$$ Since $f$ is surjective, we may substitute $f(y)$ by $y$ and the assertion still holds for all $y\in\mathbb R$: $$P(x,y):\space f(x+f(x)+2y)=f(2x)+f(2y+a)\implies\\ P\left(2a,\frac{1}{2}a\right): f(3a)=0\\ P\left(x,-\frac{1}{2}f(x)\right):\space f(x)=f(2x)+f(-f(x)+a)=f(2f(x)+a)+f(-f(x)+a)\implies\\ x=f(2x+a)+f(-x+a)$$ The last implication is again due to surjectivity. Furthermore, with $x=a$, we obtain $a=f(0)$. Now, we take a look at the original equation with $x=y=0$: $$f(3f(0))=2f(0)\implies a=f(0)=0$$ Thus, $x=f(2x)+f(-x)$ and with $y=-\frac{1}{2}x$ in $f(x+f(x)+2y)=f(2x)+f(2y+a)$ we obtain $f(f(x))=f(2x)+f(-x)=x$. Thus, $f$ is injective. Now, with $y=0$, we have $f(x+f(x))=f(2x)\implies f(x)=x$ and we're done.