If a surjection f: $ \mathbb{R}^n \to \mathbb{R}^n $ satisfies $$ \langle f(v),f(v)\rangle =\langle v,v\rangle =\sum_{i=1}^n x_i^2 $$ for all $ v $ then must $ f $ be a linear transformation?
Here is my attempt at a proof. By
Could a non-linear transformation be orthogonal?
it is enough to show that $ f $ satisfies $ \langle f(u),f(v)\rangle =\langle u,v\rangle $ for all $ u,v \in \mathbb{R}^n $. Normally I would conclude that $ f $ preserves the inner product from the fact that $ f $ preserves the norm $$ \|f(v)\|=\|v\| $$ together with the polarization identity. $$ \langle u,v\rangle =\frac{\|u+v\|^2-\|u\|^2-\|v\|^2}{2}=\frac{\|f(u+v)\|^2 -\|f(u)\|^2-\|f(v)\|^2}{2} $$ and $$ \langle f(u),f(v)\rangle =\frac{\|f(u)+f(v)\|^2-\|f(u)\|^2-\|f(v)\|^2}{2} $$ But I am not assuming additivity of $f$, $f(u+v)=f(u)+f(v)$, so preserving norm and preserving inner product are no longer equivalent (at least not because of the usual argument).
If this is false then give an example of a surjective $ f: \mathbb{R}^n \to \mathbb{R}^n $ satisfying $$ \langle f(v),f(v)\rangle =\langle v,v\rangle =\sum_{i=1}^n x_i^2 $$ which is not linear. Preferably your counterexample $ f $ should be a homeomorphism (continuous with continuous inverse). Even better, $ f $ should be written in terms of specific recognizable (preferably analytic) functions. I'm also curious what is the group of all invertible $ f $ that preserve standard norm on $ \mathbb{R^n} $? Just the $ n \times n $ orthogonal group?
As stated, the answer is no.
For example, let $S^{n-1}$ be the unit sphere in ${\mathbb R}^n$ and let $\phi: S^{n-1}\to S^{n-1}$ be any diffeomorphism (i.e. bijective differentiable map), then define $$ f(v)=|v|\cdot \phi\Big(\frac{v}{|v|}\Big), $$ then $|f(v)|=|v|$.
This $f$ is continuous. And differentiable except at $0$. We can modify this construction to make $f$ differentiable everywhere.
On the other hand, if you assume $\langle f(u), f(v)\rangle =\langle u, v\rangle$, then the answer is yes.