Generalisation of a multivariable calc problem I remember the following problem back from my undergraduate days:

Suppose that  $f\in C^1(\mathbb{R}^n)$ is a map such that for all p, we have $df(p)\in SO(n)$. Then, $df$ is a constant rotation, or in other words, $f$ is an affine rotation.

There is a clever proof of this fact using local inversion to prove that at any point, your map $f$ must be locally an orientation-preserving isometry.
I can't think of any similar-looking result, so my question is the following: 

Is this exercise just an isolated fact, or is it a special case of a more general phenomenon? 

Given how often we build undergraduate-level problems from special cases, I am now curious.
 A: There is also a generalization in a slightly different direction. The simplest version I know is that if $f:\mathbb R^n\to \mathbb R$ and $|\nabla f|=1$ everywhere (which is true for each coordinate mapping in your original problem), then $f$ is linear. The solution is to go along the gradient accent/descent curves and to note that they are straight lines because otherwise you have too big increments over the straight shortcuts. Once you know that, you note that if you have any point $p$ with $f(p)=y$, then any other point $q$ with $f(q)=y$ is on the plane perpendicular to the gradient line through $p$ (otherwise we can go far enough on that gradient line and then take a shortcut to $q$ from there). Since the level sets are nice locally, we conclude that they are planes, after which everything becomes obvious. 
Unfortunately, I do not remember now what other theorems are there about what can and what cannot be an absolute value of a gradient and how rigid is the set of solutions if it is non-empty.  
A: This is the theorem that the only maps that are infinitesimal isometries are global isometries. For a general riemannian manifold this is still an important but basic fact. Also important and a consequence of this proof is the fact that the group of isometries is finite dimensional. 
A: I'd say that a natural generalization is the study of conformal mappings in $\mathbb{R}^n$ and in particular the celebrated Liouville theorem.
