You can prove that $\langle f(x),f(y) \rangle = \langle x,y \rangle$ for any real Hilbert Space by deriving the following expressions for $\|f(x) - f(y)\|^2$ and $\|x-y\|^2$:
\begin{align*}
\|f(x)-f(y)\|^2 &= \langle f(x) - f(y), f(x) - f(y)\rangle \\
&= \|f(x)\|^2 - 2\langle f(x),f(y)\rangle + \|f(y)\|^2\\
\end{align*}
and
\begin{align*}
\|x-y\|^2=\langle x-y,x-y\rangle &= \|x\|^2 - 2\langle x,y\rangle + \|y\|^2
\end{align*}
Since $\|f(x)-f(0)\| = \|x - 0\|$, and $f(0) = 0$, you know $\|f(x)\| = \|x\|$. Therefore, after setting the two expressions equal to each other, the correct terms match up to give preservation of the inner product, as claimed.
Then you can use this to show that
$$\|f(x+y) - f(x) - f(y)\|^2 = \langle f(x+y) - f(x)-f(y), f(x+y)-f(x)-f(y)\rangle = 0,$$
therefore proving that $f$ is additive. The same should work for $f(\lambda x)$.
Showing the preservation of the inner product for a complex Hilbert space won't work using the same trick; the farthest I've gotten with it is showing that the real part of $\langle f(x),f(y)\rangle$ is equal to the real part of $\langle x,y\rangle$. All of the proofs I've seen that show equality in the complex case assume that $f$ is already linear and just use the polarization identity
$$\langle x,y\rangle = \frac{1}{4}(\|x+y\|^2 - \|x-y\|^2 +i\|x+iy\|^2 -i\|x-iy\|^2)$$
on $\langle f(x),f(y)\rangle$. I suspect it is true in the complex case, I just haven't found out why.