Let $X$ be a metric space and $F$ an isometry of $X$. Suppose $F$ fixes each point of a non-empty open set $U\subset X$.
Under what conditions on $X$ does it always follow that $F=\mathrm{id}$?
I already know it holds when $X$ is a complete connected Riemannian manifold, by Theorem 6.6.10 in Ratcliffe.
A sufficient condition is that
In the literature, the latter condition is usually stated simply as "geodesics do not split".
Suppose the above hold. Given any point $x\in X$, join it by a (local) geodesic to a point $y\in U$. Its image under $F$ is also a geodesic, but since $U$ is fixed pointwise, the two geodesics coincide within $U$. Therefore, they coincide, and $F(x)=x$.
Here is an counterexample showing the importance of non-splitting of geodesics. Let $X$ be $\mathbb R^2\setminus \{(x,0): x\ne 0\}$, with the intrinsic metric (i.e., the distance between points is the length of the shortest curve between them). This is a geodesic space: moreover, any two points are joined by a unique distance-minimizing geodesic. The map $F(x,y) = (x\operatorname{sign}y , y )$ is an isometry which fixes the upper halfplane pointwise but is not the identity.
Slight variation of the above: To give an example where $X$ is complete, let $X=\{(x,y)\in \mathbb R^2:|y|\ge |x|\}$, also with the intrinsic metric. The same $F$ works.
The geodesic language is cumbersome here because in the metric space world, it usually means a globally-length-minimizing curve, while in Riemannian geometry it means a locally-minimizing curve.