Find all functions $g$ from the Real numbers to itself, satisfying $g(x + y) + g(x)g(y) = g(xy) + g(x) + g(y) . .(*)$
This is a National Olympiad problem, however, my solution is quite different from the one provided by the author so I need you people to check my solution and tell me if its correct.
Solution:
setting $y = 0$ in $(*)$, we obtain
$g(x) + g(x)g(0) = 2g(0) + g(x)$, or $g(0)(g(x) - 2) = 0$.
So either $g(0) = 0$ or $g(x) = 2$, because$g(0) = 0$, is a valid solution, it follows that $g(x) = x$. $g(x) = 2$ are solutions as well.