Extension of isometries on submanifolds of a riemannian manifold Let $S$ be a submanifold of a Riemannian manifold $M$. Suppose that the closure of $S$ is equal $M$, i.e, $\bar{S}=M$. 
When can we extend an isometry (as Riemannian manifold) $f:S\to S$ to an isometry $\tilde{f}:M\to M$?
 A: This is a partial answer, mainly intended to point out a class of counterexamples.
1. If "isometry" means that $f : S \to S$ preserves the metric in the sense that $d_M(f(x), f(y)) = d_M(x,y)$ for points $x,y \in S$, then it seems that all you need is the assumption that $M$ is complete. In this case, of course, there's no need to assume that $S$ is a submanifold.
2. On the other hand, you may mean for $S$ to be an immersed submanifold and $f$ to be preserving the Riemannian metric on $S$ given by pulling back the Riemannian metric on $M$ via the inclusion. In this case I do not have a definite condition on $S$ for there to exist such an extension, but I suspect that it is rare. 
As a large class of counterexamples to possible conjectures one might make, consider any Riemannian manifold $M$ satisfying the conditions:
(a) $M$ has a geodesic $\gamma$ whose orbit is dense; and
(b) $M$ has finite isometry group.
We take $S$ to be the submanifold given by the orbit of $\gamma$; there is a one-parameter family $\phi_a$ of orientation-preserving isometries of $S$ given by $\phi_a : \gamma(t) \mapsto \gamma(t + a)$ for $a \in \mathbb{R}$. These isometries are distinct on $S$. Since $M$ has finite isometry group, most of these isometries cannot come from restrictions of isometries of $M$.
Every closed hyperbolic surface satisfies (a) and (b), so such manifolds definitely exist. 
In any case, any condition we impose on $S$ or $M$ to try to get our conclusion will have to exclude such examples; no such natural condition comes to my mind, but maybe others will have more success. 
