Let $(M, g), (N,h)$ be Riemannian manifolds and consider $d_g$ and $d_h$ the corresponding distance functions induced from $g$ and $h$.
Suppose $f: M \rightarrow N$ is a bijective isometry in the metric sense i.e. $d_h(f(x), f(y)) = d_g(x,y)$. Is it true that $f$ must be smooth and, moreover, that $f^* h = g$?
In more generality, if $M$ and $N$ are only smooth manifolds and $d_M, d_N$ are smooth distance functions, is it true that a bijective isometry $f: M \rightarrow N$ must be smooth?
Yes, this is the content of the Myers-Steenrod theorem.
Besides the Wikipedia references, you can find a proof for instance in
Petersen, Peter, Riemannian geometry, Graduate Texts in Mathematics 171. New York, NY: Springer (ISBN 0-387-29246-2/hbk). xvi, 401 p. (2006). ZBL1220.53002.