Is it true that arcwise isometry that is also a local homeomorphism is a local isometry? Let $X,Y$ be length spaces. A map $f:X \to Y$ is called an arcwise isometry if $L(f(\gamma))=L(\gamma)$ for every path $\gamma$. 

In the book "A course in metric geometry" (Burago & Burago & Ivanov) it is claimed that an arcwise isometry that is a local homeomorphism is a local isometry. 

A map $f : X \to Y$ is called a local isometry at $x ∈ X$ if $x$
has a neighborhood $U$  such that the restriction $\left.f\right|_U$ maps $U$ isometrically onto an open set $V$ in $Y$. In other words 
the map $\left.f\right|_U:(U,\left.d^X\right|_U) \to (V,\left.d^Y\right|_V)$ is an isometry. (Note that we are using the restrictions of the metrics on $X,Y$, not the induced intrinsic distances which only allow for paths that stay inside $U,V$).
A map which is a local isometry at every point
is called a local isometry.


I do not see why this is needs to be true. I think there is a problem if points in $Y$ don't have convex neighbourhoods.

Indeed, let $p \in X$. There exists open sets $p \in U \subseteq X,f(p) \in V \subseteq Y$ such that $f:U \to V$ is a homeomorphism. Since $f$ is an arcwise isometry, it is $1$-Lipschitz, so
$$ (1)\, \, d^Y(f(p),f(q)) \le d^X(p,q)$$
Even if we knew $f^{-1}:V \to U$ also preserves lengths the only thing we could conclude is that
$$  (2)\, \,  d^X(p,q) \le d^U(p,q) \le d^V(f(p),f(q))$$
(where $d^U,d^V$ are the intrinsic metrics induced on $U$,$V$)
However, if $V$ is not convex then it's possible that $ d^V(f(p),f(q)) > d^Y(f(p),f(q))$ so we don't have a way to combine inequalities $(1)$ and $(2)$.

So, is the assertion true? Or do we indeed need some local-convexity assumptions on $Y$?


 A: I am trying to write an answer based on the comment of Moishe Cohen.
We start with an observation:
Let $X,Y$ be metric spaces. For any homeomorphism $f:X \to Y$ which is also an arcwise isometry, $\, f^{-1}:Y \to X$ is an arcwise isometry. 
Proof:
Let $\alpha$ be a path in $Y$. Then $f^{-1}(\alpha)$ is a path in $X$, and by the definition of arcwise isometry $L_Y(\alpha)=L_Y\big( f (f^{-1}(\alpha))\big)=L_X\big( f^{-1}(\alpha) \big)$.

Lemma: (A proof is at the end of the question)
Let $(X,d)$ be a length space. Let $x\in X,U$ an open neighbourhood of $x$ in $X$. Then, for every $\epsilon>0$ sufficiently small there exists an $r >0$ such that $ B(x,r) \subseteq U$ and forall $x_1,x_2 \in B(x,r)$ every $\epsilon$-minimizing path between $x_1,x_2$ in $X$ is contained in $U$.
In particular $d^U(x_1,x_2)=d^X(x_1,x_2) $.

A proof of the main proposition, using the above lemma:
First, as noted in the question, we already know that
$$ (1)\, \, d^Y(f(q),f(q')) \le d^X(q,q')$$
Let $p \in X$. There exists open sets $p \in U \subseteq X,f(p) \in V \subseteq Y$ such that $\left.f\right|_U:U \to V$ is a homeomorphism.
Let $\epsilon > 0$. By the lemme there exist $B(f(p),r) \subseteq V$, such that for every $q,q' \in (\left.f\right|_U)^{-1}\big(B(f(p),r)\big) \subseteq U$
$$  (2)\, \,  d^V(f(q),f(q')) = d^Y(f(q),f(q')) $$
The assumption that $f:X \to Y$ is an arcwise isometry, implies
that $\left.f\right|_U:U \to V$ is an arcwise isometry.
So, by the observation we made at the beginning, $(\left.f\right|_U)^{-1}:V \to U$ is an arcwise isometry, hence $1$-Lipschitz w.r.t the intrinsic distances on $V,U$ (which we denote by $d^V,d^U$).
Thus, if $q,q' \in (\left.f\right|_U)^{-1}\big(B(f(p),r)\big) \subseteq U$ then
$$  (3)\, \,  d^X(q,q') \le d^U(q,q') = d^U\bigg((\left.f\right|_U)^{-1}\big(f(q)\big),(\left.f\right|_U)^{-1}\big(f(q)\big)\bigg) \le d^V(f(q),f(q'))$$
Now combine $(2),(3)$ to obtain
$$ (4)\, \,  d^X(q,q') \le d^Y(f(q),f(q'))  $$
So, $(1),(4)$ together imply that $f: (\left.f\right|_U)^{-1}\big(B(f(p),r)\big) \to B(f(p),r)$ is an isometry.

A proof of the lemma:
Let $\epsilon >0$ be small enough such that $B(x,4\epsilon) \subseteq U$. Let $p,q \in B(x,\epsilon)$. Then $d(p,q) < 2\epsilon$. Let $\alpha$ be an-$\epsilon$ minimizing path between $p,q$, i.e:
$$ L(\alpha) < d(p,q) + \epsilon < 3\epsilon$$
Then,
$$ d(x,\alpha(t)) < d(x,p)+d(p,\alpha(t)) < \epsilon + L(\alpha) < 4\epsilon$$
so  $\alpha(t) \in B(x,4\epsilon) \subseteq U$.
