TITLE: Are inner product-preserving maps always linear?
QUESTION [11 upvotes]: Let $E,F$ be Pre-Hilbert spaces and $T: E \rightarrow F$ be a map that preserves the inner product, that is $\langle Tu , Tv \rangle = \langle u , v \rangle$ for all $u,v \in E$. Must it be true that $T$ is linear? If $T$ is surjective one has
$$\langle T(\lambda u+v), Tw\rangle = \langle \lambda u + v, w \rangle = \lambda \langle u, w \rangle + \langle v, w \rangle = \langle \lambda Tu, Tw \rangle + \langle Tv, Tw \rangle  \iff \langle T(\lambda u + v) - \lambda T u - Tv, Tw\rangle = 0$$
Now since $T$ is surjective one can choose $Tw$ to be $ T(\lambda u + v) - \lambda T u + Tv$, and by positive definiteness the linearity follows. Can this somehow be extended if $T$ isn't surjective?

REPLY [5 votes]: Here is a short proof. 
$$\begin{split}
\|T(\lambda u + w) - \lambda T(u)  - T(w) \|^2 
&= \langle T(\lambda u + w) - \lambda T(u)  - T(w) , T(\lambda u + w) - \lambda T(u)  - T(w)  \rangle\\
&=\langle T(\lambda u + w)  , T(\lambda u + w) \rangle + \text{more such terms}\\
&= \langle \lambda u + w , \lambda u + w\rangle + \text{more such terms}\\
&= \langle (\lambda u + w) -\lambda u-w, (\lambda u + w) -\lambda u-w\rangle= 0.
\end{split}$$
In the second step, we apply linearity of the inner product to arrive at a sum of terms of the type $\langle T(a),T(b)\rangle=\langle a,b\rangle$. In the last step, we put everything back into one inner product.