Let $f(x)$ be a function such that $f(0)=1$ and $f(xy)=f(\frac{x^2+y^2}{2})+(x-y)^2$ for all real numbers $x$ and $y$. Find $f(x)$.
Trying a few values, I'm getting f(x) = x + 1.