Projection function preserving distance Given $n>1$. I wis to construct a function $f:\mathbb{R}^n\mapsto\mathbb R$ such that $$\|X_1-X_2\|\le\|Y_1-Y_2\|\implies|f(X_1)-f(X_2)|\le |f(Y_1)-f(Y_2)|$$ for all $X_1,X_2,Y_1,Y_2\in\mathbb{R},$ where $\|\cdot\|$ denotes the usual norm.
It is like finding a projection function, isn't it? I haven't a clue for this problem. I tried putting $f(X)=\|X\|$ but it doesn't work. Any suggestion?
 A: Let $f:\mathbb{R}^n\to\mathbb{R}$ satisfy the desired condition. It follows that whenever $\|x_1-y_1\|=\|x_2-y_2\|, $ we have $|f(x_1)-f(y_1)|=|f(x_2)-f(y_2)|$, thus equilateral triangles are mapped by $f$ to equilateral triangles. Since all equilateral triangles on the line are trivial, and every $x,y\in\mathbb{R}^n$ are two verices of an equilaterla triangle, it follows that $f$ is constant.
Note furthermore that a similar argument can prove that for any $n<m$, every $f:\mathbb{R}^m\to\mathbb{R}^n$ with the above property is constant.
A: As Daniel already stated in a comment, for $f$ constant this is trivially true.
So let's assume $f$ is not constant. Then there exist at least two distinct points in $\mathbb R^n$ which map to two distinct values. Let's call these points $P$ and $Q$. Consider two distinct paths from $P$ to $Q$ which have no other points in common. I believe that you can show that values along such a path must change in a continuous and monotonic way, even though I don't feel like writing down all the details for this. So for $Y_1$ moving along a path from $P$ to $Q$, the value $f(Y_1)$ will vary continuously and monotonically from $f(P)$ to $f(Q)$. The same holds for a point $Y_2$ moving along the other path. So for every point $Y_1$ on one path there exists a corresponding point $Y_2$ on the other path such that $f(Y_1)=f(Y_2)$. Since the paths are distinct, you have $\lVert Y_1-Y_2\rVert>0$. Now you can easily come up with values $X_1,X_2$ which are closer together but have non-zero value difference.
So there can be no non-constant functions satisfying your requirements.
