TITLE: Example of non-surjective isometry of metric space
QUESTION [6 upvotes]: I need an example of an isometry, $f$, from a metric space $X \rightarrow X$ that is not surjective. My example was letting the metric space be the set of non-negative real numbers with d$(x,y) := \max(x,y) - \min(x,y)$ if $x \neq y$, and $0$ if $x = y$. Then my isometry would be $f(x) = x+1$, so $0$ would not be in the image of $f$.
Is this a valid example? I don't know whether this is a real metric space, I just came up with it on my own.

REPLY [4 votes]: Your metric $d$ is the same as the standard metric $d'(x,y) = |x - y|$ on $[0,\infty)$ and your example indeed works.