Distance-preserving map from the upper half-plane to itself Let $\mathbb H$ be the upper half-plane with the hyperbolic metric and let $f \colon \mathbb H \to \mathbb H$ be a distance-preserving function.
I know that any orientation-preserving isometry (i.e. bijective distance-preserving map) is given by a Möbius transformation associated to a matrix in $\mathrm{SL} (2, \mathbb R)$.
If $f$ is only assumed to be distance-preserving, then $f$ is clearly injective and continuous, but I believe that surjectivity should follow as well, but I am not sure how to prove this. (The obvious non-injective map $\mathbb H \to \mathbb H$ given by translation by a complex number in $\mathbb H$ is not distance-preserving.)
 A: There is a synthetic proof which is pretty much the same as the synthetic proof in Euclidean geometry. This proof depends solely on facts about the geometry itself and its isometry group.
To start with, the full group of isometries $\text{Isom}(\mathbb H^2)$ contains $\text{PSL}(2,\mathbb R)$ as an index 2 subgroup, and so $\text{Isom}(\mathbb H^2)$ is generated by  $\text{PSL}(2,\mathbb R)$ plus one orientation reversing isometry which we can take to be $z \mapsto -\overline z$.
Pick any three noncollinear points $P,Q,R \in \mathbb H^3$ and consider the triangle $\triangle PQR \subset \mathbb H^3$.
Letting $P'=f(P)$, $Q'=f(Q)$, $R'=f(R)$, the triangles $\triangle PQR$ and $\triangle P'Q'R'$ have the same side lengths.
The SSS theorem is true for the group $\text{Isom}(\mathbb H^2)$, and so there exists an element $\phi \in \text{Isom}(\mathbb H^2)$ such that $P=\phi(P')$, $Q=\phi(Q')$, $R=\phi(R')$. Letting
$$g = \phi \circ f : \mathbb H^2 \to \mathbb H^2
$$
it follows that $g$ is distance preserving and fixes the vertices of the one triangle $\triangle PQR$. Using that conclusion it suffices to show that $g$ is the identity, because then
$$f = \phi^{-1} \in \text{Isom}(\mathbb H^2)
$$
Pick any $S \in \mathbb H^2$. The point $S$ lies on at most two of the lines $\overline{PQ}$, $\overline{QR}$, $\overline{RP}$. By permuting the $P,Q,R$ notation as needed, we may assume that $S$ does not lie on the line $PQ$. So $\triangle{PQS}$ is a true triangle.
In $\mathbb H^2$, the circle through $P$ of radius $d(P,S)$ and the circle through $Q$ of radius $d(Q,S)$ intersect in exactly two points, namely $S$ itself and the point $S'$ obtained by reflecting $S$ through the line $\overline{PQ}$.
So now one verifies the following: if $S$ and $R$ are on the same side of $\overline{PQ}$ then $d(R,S) < d(R,S')$; whereas if $S$ and $R$ are on opposite sides of $\overline{PQ}$ then $d(R,S) > d(R,S')$. In either case $d(R,S) \ne d(R,S')$ and so the only choice for $g(S)$ is $S$ itself.
