Let $\tau : \mathbb R^m \to \mathbb R^m$ be a map such that $\tau (0) = 0$ and $\langle x,y \rangle = \langle \tau(x) , \tau(y) \rangle$ for all $x,y \in \mathbb R^m$.
I want to show that $\tau$ is linear that is, $\tau \left ( \sum_i x_i e_i \right ) = \sum_i x_i \tau(e_i)$ where $e_i$ is some orthonormal basis of $\mathbb R^m$.
Since $\tau$ preserves inner products $\tau(e_i)$ is also a basis of $\mathbb R^m$. Now here is what I tried:
$$ x = \sum_{i=1}^m \langle x, e_i \rangle e_i = \sum_{i=1}^m \langle \tau(x), \tau(e_i) \rangle e_i $$
but I don't see how to get to
$$ = \sum_{i=1}^m \langle x, e_i \rangle \tau(e_i) $$
from there.
Please could someone help me with this last step in my proof?
Say $e_1,...,e_m$ is an orthonormal basis. As you mentioned, this implies that $\tau(e_1),...,\tau(e_m)$ is also an orthonormal basis. So given some $x,y\in\mathbb{R}^m$, we have for every $i$: $$ \begin{align*} \left< \tau(x+y) - \tau(x) - \tau(y),\,\,\tau(e_i)\right> &=\left< \tau(x+y),\,\,\tau(e_i)\right>-\left< \tau(x),\,\,\tau(e_i)\right>-\left< \tau(y),\,\,\tau(e_i)\right> \\ &=\left< x+y,\,\,e_i\right>-\left< x,\,\,e_i\right>-\left< y,\,\,e_i\right>\\&=0 \end{align*} $$
Now, note that if $\left<x,w_i\right>=0$ for every $w_i$ in some orthogonal basis, then $x=0$. Thus:
$$ \tau(x+y) - \tau(x) - \tau(y) = 0 \\ \tau(x+y) = \tau(x) + \tau(y)\tag{1} $$
Similarily, given some $\alpha\in\mathbb{R}$: $$ \begin{align*} \left< \tau(\alpha x) - \alpha\tau(x),\,\,\tau(e_i)\right> &=\left< \tau(\alpha x),\,\,\tau(e_i)\right>-\alpha\left< \tau(x),\,\,\tau(e_i)\right> \\ &=\left< \alpha x,\,\,e_i\right>-\alpha\left< x,\,\,e_i\right>\\&=0 \end{align*} $$
And we get:
$$ \tau(\alpha x) - \alpha\tau(x) = 0 \\ \tau(\alpha x) = \alpha\tau(x) \tag{2} $$
Combining $(1)$ and $(2)$, we conclude what is required.