If for all $x,y \in \mathbb{R}^n$ that satisfies $|x - y| = t$ also satisfies $|f(x) - f(y)|=t$ (for some constant $t \in \mathbb{R}^{+}$), show that $|f(x) - f(y)| = |x-y|$ for all values of $x,y \in \mathbb{R}^n$.
This seems very much intuitive to me and that $f(x) = x$ or that the range set is a copy of $\mathbb{R}^n$. My initial goal was to show if $r \in l(x,y)$, then $f(r) \in l(f(x),f(y))$ such that $|f(r)-f(z)| = |r - z|$ where $z \in \{x,y\}$. Showing this is enough to solve the problem. The most intuitive idea, however that seems to work is creating equilateral triangles in some way and make it work.
$\color{green}{\text{Edit :}}$ In $\mathbb{R}$, by taking $f$ as the greatest integer function with a period of $t$, we get a clear contradiction to the initial statement. The idea doesn't seem to directly work for higher dimensions, albeit the first answer claims so. Can this (or the claim in the original question) be proven for $n > 1$?
I don't think this is true without further hypothesis (continuity maybe), because we can build counter examples with periodic stuff or similar.
In $\mathbb R$ take $f(x)=\lfloor x\rfloor$ and $t=1$. Then $f(\frac12)-f(\frac 13)=0\neq \frac 12-\frac 13$.
I think we can extend that to higher dimensions without too much issues.