Find all functions $f:\mathbb{R} \rightarrow \mathbb{R}$ such that $$x^2+y^2+2f(xy)=f(x+y)(f(x)+f(y))$$
So here's my solution,
If $x=y=0$,
$2f(0)=2f(0)^2$
$\implies f(0)=0$ or $f(0)=1$.
Case $1$: $f(0)=0$
If $y=0$,
$x^2+2f(0)=f(x)(f(x)+f(0))$ $$f(x)^2=x^2$$
Now suppose for the sake of contradiction that $f(x)=-x$ for some $x \in \mathbb{R/\{0\}}$. Then, $x^2+y^2-2xy=(-x-y)(-x-y)$ $$\implies (x-y)^2=(x+y)^2$$ which is a contradiction as $x+y=\pm(x-y)$ forces $x$ or $y$ to equal $0$ which isn't permitted.
Hence $f(x)=x$, conversely one readily checks that this satisfies the given equation.
Case $2$: $f(0)=1$
Again let $y=0$ and then $$f(x)^2+f(x)-x^2-2=0$$ (remember we're assuming $f(0)=1$)
Solving for $f(x)$ we get $$f(x)=\frac{-1 \pm \sqrt{4x^2+9}}{2}$$
If you allow the plus or minus to be a minus $f(0) \not= 1$. Therefore it must be a plus.
But when you sub it back in to the original equation and then putting $x=y=1$ it does not work. Hence it does not work for all $x$ contradiction hence $f(x)=x$ as in case one is the only solution. QED
My concern here is the last paragraph - Can I do that? Is it tight? If so, is there a better and more mathematically "professional" (for the lack of a better word) way to phrase it?
Any help would be greatly appreciated.