Does isometric immersion map boundary to boundary? Let $M$ be a compact, connected, oriented, smooth Riemannian manifold with non-empty boundary. Let $f:M \to M$ be a smooth orientation preserving isometric immersion.
Is it true that $f(\partial M) \subseteq \partial M$?
Edit: In this paper, it is proved that any "local isometry" from a compact, connected metric space into itself is a homeomoprhism, where by a "local isometry", they mean  "locally preserving distance". 

Thus, if every isometric immersion is locally preserving distance, then our $f$ will be a homeomorphism (hence will map boundary to boundary). 

Is it true that isometric immersion $\Rightarrow$  locally preserving distance?
Motivation:
A positive answer to this question would imply that every smooth orientation preserving isometric imersion $M \to M$ is a Riemannian isometry (see details below**), Moreover, if two manifolds can be isometrically immersed in each other, then they are isometric (see remark 1 in the "updates and remarks" of this question).
In particular, to refute the conjecture "$f(\partial M) \subseteq \partial M$" it is enough to find such an immersion which is not surjective, or at least not an isometry.
Remarks:
(1) Compactness is essential. Look at $M=[0,\infty) \,,\,f(x)=x+1$.
(2) The claim clearly holds in dimension $1$ ($M$ must be a closed interval).

** Indeed, since $f(\partial M) \subseteq \partial M$ and it's easy to see that $f(M^o) \subseteq M^o$ we get that $f(M^o)$ is clopen in $M^o$, thus $f(M^o)=M^o$. Since $f(M)$ is closed in $M$, and contains $M^o$, we conclude $f(M)=M$, and so $f(\partial M)= \partial M,f(M^o)=M^o$. 
So, $f$ is a surjective $1$-Lipschitz map from a compact space to itself. (The $1$-Lipshictzity follows since isometric immersions preserve lengths of paths). Thus, it is a metric isometry. Hence, by the positive answer to this question, $f$ is smooth, and in fact a Riemannian isometry.
 A: The following relies on the answer of Anton Petrunin and his explanations.
Set $X:=\cap_{n\geq 1} f^n(M)$.
Claim 0: Each $x\in X$ is a limit point of a sequence $f^n(y)$ for some $y\in M$. Moreover, if $x\in X\cap M^\circ$, then $y$ can be chosen in $M^\circ$.
Proof of Claim 0: 
Assume $x\in X$. Then $x=f^n(y_n)$ for some $y_n\in M$ and each $n\geq 1$.
After passing to a subsequence, we may assume that $y_{n_l}\rightarrow y$.
Fix $\varepsilon>0$ and $K\geq 1$;
we show that for some $k\geq K$, $f^k(y)\in B_\varepsilon(x)$.
Choose $l\geq 1$, such that $k:=n_l\geq K$ and $y_{k}\in B_\varepsilon(y)$.
Then, since $f$ is distance non-increasing, $dist(f^k(y),f^k(y_k))\leq dist(y,y_k)<\varepsilon$.
The 'moreover' statement follows, since we can replace $y$ by $f^{k_0}(y)$,
and choose $k_0$ such that $f^{k_0}(y)\in M^\circ$; the latter is possible, since a subsequence of
$f^n(y)$ converges to $x\in M^\circ$.
Claim 1: For any $x\in M^\circ$ and $r>0$ such that $B_r(x)\subset M^\circ$  and $n\geq 1$, we have $f^n(B_r(x))=B_r(f^n(x))$.
We defer a proof of Claim 1 to the end.
Claim 2: $X^\circ$ is nonempty, indeed it coincides with the set of all limit points of sequences $f^n(y)$ for $y\in M^\circ$.  
Proof Claim 2: By Claim 0, each $x\in X\cap M^\circ \supset X^\circ$ is such a limit point. Conversely, if $x$ is such a limit point, then $x\in B_r(f^k(y))=f^k(B_r(y))\subset f^k(M)$ for (certain) arbitrary large $k$; here we choose $r$ such that $B_r(y)\in M^\circ$ and use Claim 1. Therefore $x\in X=\cap_{n\geq 1} f^n(M)$, since the intersection is decreasing. Actually the same argument shows, that $B_s(x)\subset X$ for each $s<r$ (or also $s\leq r$). As a consequence $x\in X^\circ$.
Claim 3: $X\cap M^\circ$ is open in $M^\circ$. (Clearly it is also closed, as $M$ is compact and nonempty by Claim 2).
Proof Claim 3: Combining Claim 1 and 2, we see that $X\cap M^\circ=X^\circ=X^\circ \cap M^\circ$ is open in $M^\circ$.
As $M^\circ$ is connected, Claim 3 implies:
Claim 4:  $X\cap M^\circ=M^\circ$. Since $X\subset M$ is closed, it follows that $X=M$, and thus $f(M)=M$.
Conclusion:Claim 4 implies that $f$ is a distance preserving homeomorphism by Całka, Corollary 3.5 and Corollary 4.4. In particular, $f(\partial M)=\partial M$.
A (standard) proof of Claim 1: First assume n=1: Since $f$ is $1$-Lipschitz, we have $f(B_r(x))\subset B_r(f(x))$ for any $x\in M^\circ$. To show equality, let $y\in B_r(f(x))$ arbitrary. There exists a path (of constant speed) $\gamma:[0,1]\rightarrow M^\circ$ of length $<r$ with $\gamma(0)=f(x)$ and $\gamma(1)=y$.
There exists a unique lifting of $\gamma$, i.e. a path $\eta:[0,1]\rightarrow M^\circ$ with $f\circ \eta=\gamma$ and $\eta(0)=x$. 
(The set $T\subset [0,1]$ of $t$'s for which there is a unique lifting of $\gamma$ on the intervall $[0,t]$ contains $0$. $T$ is open since $f$ is a local diffeomorphism on $M^\circ$. In addition, $T$ is closed: If $t_k\in T$ converges to $t\in [0,1]$, then there is a unique lift $\eta_0$ of $\gamma$ on $[0,t)$. Since $M$ is compact and $\eta_0$ is Lipschitz, we can extend it to a path $\eta_1:[0,t]\rightarrow M$, and we have automatically $f(\eta_1(s))=\gamma(s)$ for $s\in [0,t]$. Since $length(\eta_1)=length(\gamma\vert_{[0,t]})<r$ as $f$ is an infinitesimal isometry, we have $\eta_1(t)\in B_r(x)\subset M^\circ$ and therefore $t\in T$, as desired.)
Since $f$ is an (infinitesimal) isometry, length($\eta$)=length$(\gamma)<r$ and thus $\eta(1)\in B_r(x)$. 
Therefore $y=f(\eta(1))\in f(B_r(x))$, as claimed for $n=1$.
For arbitrary $n\geq 2$, note that $f^{n-1}(B_r(x))=B_r(f^{n-1}(x))$ by induction.
The domain invariance theorem (applied locally to $f^{n-1}$) implies that $f^{n-1}(M^\circ)\subset M^\circ$; hence if $B_r(x)\in M^\circ$, then so is
$f^{n-1}(B_r(x))$. Applying Claim 1 for $n=1$ to the ball $B_r(f^{n-1}(y))$ yields Claim 1 for $n$.
A: If by an isometric immersion you mean infinitesimally isometric (each tangent mapping is a linear isometry) then the obvious mapping $M_2\to M_1$ in example 4 of the following paper is an isometric immersion which is not surjective and not injective and does not map boundary points to boundary points. There, $M_1$ and $M_2$ are diffeomorphic but not isometric.


*

*Franz W. Kamber, Peter W. Michor: Completing Lie algebra actions to Lie group actions. Electron. Res. Announc. Amer. Math. Soc. 10 (2004) 1-10. pdf
So I assume that by an isometric immersion you mean isometric in the sense of distance preserving. But then, $f$ is injective: If $f(x)=f(y)$ for $x\ne y$ we cannot have $0=dist(f(x),f(y)) = dist(x,y)>0$. Thus $f(M)$ is a submanifold with boundary of $M$ and the arguments given in the remarks above show that the measure of $f(M)$ (which equals the measure of $M$) must be smaller that the measure of $M$, if $f$ is not surjective.
A: Let me mimic the argument of Całka:
Note that the map $f$ is short.
Set 
$$X=\bigcap_n\, f^n(M)$$
Note that $f|_X$ is an isometry.
Note that for any positive integer $n$, any small convex ball in the interior of $M$ is mapped by $f^n$ isometrically. 
In particular $X$ has nonempty interior.
Indeed, a $2{\cdot}r$-ball in the interior is mapped to a $2{\cdot} r$-ball and the map is length-preserving. It follows that the corresponding $r$-ball maps isometrically to an $r$-ball.
Assume $X\ne M$.
Fix $z\in M\backslash X$ which lies in a small ball centered in $X$.
Note that the distance from $f^n(z)$ to $X$ is constant.
On the other hand the set of partial limits of $f^n(z)$ have to lie in $X$, a contradiction. 
So, $f$ is an isometry as short map from a compact space to it self.
In particular $f(\partial M)=\partial M$
