Isometry on open sets Hi folks, I'm working on this problem (I don't know if it's true yet).

Let $f:\mathbb R^m \to \mathbb R^m$ be a $C^1$ function, $V_0$ and $W_0$ open sets of $\mathbb R^m$ such that $f|_{V_0}$ and $f|_{W_0}$ is a isometry i.e.:
  
  
*
  
*$d(x_1,x_2)=d(f(x_1),f(x_2))$ for all $x_1,x_2\in V_0$
  
*$d(y_1,y_2)=d(f(y_1),f(y_2))$ for all $y_1,y_2\in W_0$
  
  
  If $x_0\in V_0$, $y_0\in W_0$ and $d(x_0,y_0)=d(f(x_0),f(y_0))$ then:
  
  
*
  
*$d(x,y)=d(f(x),f(y))$ for all $x\in V_0$ and $y\in W_0$.
  

All I could do up to now, was to show that for all $x\in V_0$ and $y\in W_0$, if we denote $a=d(x,x_0)+d(x_0,y_0)+d(y_0,y)$ and $b=d(f(x),f(x_0))+d(f(x_0),f(y_0))+d(f(y_0),f(y))$, then $a=b$ and 


*

*$d(f(x),f(y))\leq a$

*$ d(x,y)\leq a$
Any help would be appreciated!
 A: This is not true: take $\mathbb{R}^2$, let $d$ be the usual Euclidean distance, and $V_0$, $W_0$ be two disjoint open disks with disjoint closures (so the minimum distance between them is positive, basically). Define $f$ to be a rotation by a small positive angle on one disk, and rotation by a small negative one on the other, and smooth it together in between. This obviously satisfies the isometry condition.
Then if we take $x_0$ as the centre of $V_0$ and $y_0$ as the centre of $W_0$, $d(x_0,y_0) = d(f(x_0),f(y_0))$, but this is clearly not the case for arbitrary $x \in V_0,y \in W_0$ (the points in the areas near the closest points move further away from one another, for example).
A: This isn't true. If $m=1$ and $d(x,y)=|x-y|$, let $f:\mathbb R\to \mathbb R$ be defined such that $f(x)=-x$ when $0\leq x\leq 1$, $f(x)= 4-x$ when $2\leq x\leq 3$, and extend smoothly to all of $\mathbb R$. 
Let $V_0=(0,1)$, $W_0=(2,3)$, $x_0=\frac12$, and $y_0=\frac52$.  Then $f$ is an isometry on each of these open sets, and $|f(\frac12)-f(\frac52)|=|-\frac12-(4-\frac52)|=2=|\frac12-\frac52|$. However $|f(\frac14)-f(\frac{11}{4})|=\frac32\neq\frac52=|\frac14-\frac{11}{4}|$.
Specifically you could take $f(x)=-x$ when $x\leq 1$, $f(x)=4-x$ when $x\geq 2$, and $f(x)=16(x-\frac32)^5-16(x-\frac32)^3+6(x-\frac32)+\frac12$ when $1\leq x\leq 2$ to get a picture like this:

