James Munkres in the text "Analysis on Manifolds" give the following definition.
Definition
Let $h:\Bbb R^n\rightarrow\Bbb R^n$. We say that $h$ is a (euclidean) isometry if $$ ||h(x)-h(y)||=||x-y|| $$ for all $x,y\in\Bbb R^n$. Thus an isometry is a map that preserves euclidean distances.
So I ask to me if it is possible to generalise the above definition to general metric spaces and reserchig I found on Wikipedia the following definition.
Definition
If $(X,d_X)$ and $(Y,d_Y)$ are mteric spaces then a function $f:X\rightarrow Y$ is called isometry if $$ d_Y\big(f(x),f(y)\big)=d_X\big(x,y\big) $$ for any $x,y\in X$.
So I ask to me finally if the following statement is true.
Statement
Let $(X,d_X)$ and $(Y,d_Y)$ two metric spaces. So the isometries from $X$ to $Y$ are embedding locally lipschitz of $X$ in $Y$.
Unfortunately I don't be able to prove the last statement so I ask to do it. So could someone help me, please?
Lemma
Let $(X,d_X)$ and $(Y,d_Y)$ two metric spaces. So the isometries from $X$ to $Y$ are embedding locally lipschitz of $X$ in $Y$.
Proof. So with this definition clearly the isometries are injective functions: infact $x$ and $y$ are two distinct points of $X$ if and only if $d_X(x,y)\neq 0$ and so if and only if $d_Y\big(f(x),f(y)\big)\neq 0$ and so if and only if $f(x)$ and $f(y)$ are two distinct points of $Y$. So if $Z:=f[X]$ then we can define an inverse function $g:Z\rightarrow X$ through the condition $$ g(z):=f^{-1}(z) $$ for any $z\in Z$ and so if $x,y\in Z$ are such that $g(x)=g(y)$ then by the injectivity of $f$ it is $x=y$ so that $g$ is injective too and besides $(g\circ f)=\text{Id}$. Furthermore the isometires are contiuous functions: infact if $d_X(x,y)<\epsilon$ then clearly $$ d_Y\big(f(x),f(y)\big)<\epsilon $$ for an arbitrary $\epsilon>0$. Finally the inverse function of an isometry is an isometry too: indeed $$ d_Y(x,y)=d_Y\Big(f\big(f^{-1}(x)\big),f\big(f^{-1}(y)\big)\Big)=d_X\big(f^{-1}(x),f^{-1}(y)\big)=d_X\big(g(x),g(y)\big) $$ for any $x,y\in Z$ so that $g$ is continuous too. So we conclude that an isometry is an embeddig. Finally by definition of isometry $$ \frac{d_Y\big(f(x),f(y)\big)}{d_X(x,y)}=1 $$ for any $x,y\in X$ so that an isometry is globally lipschitz and so locally lipshitz too.