If $T_t$ is a flow and $M$ is a manifold with $T_t(\partial M)⊆\partial M$ for all $t$, we've already got $T_t(\partial M)=\partial M$ for all $t$ Let $d\in\mathbb N$, $k\in\{1,\ldots,d\}$, $M$ be a $k$-dimensional embedded $C^1$-submanifold of $\mathbb R^d$ with boundary and $f$ be a $C^1$-diffeomorphism from $\mathbb R^d$ onto $\mathbb R^d$ with $f(\partial M)\subseteq\partial M$.

Assume $\partial M$ is closed in $\mathbb R^d$.$^1$ How can we show that $f(\partial M)=\partial M$?

First of all, since $f$ is a homeomorphism from $\mathbb R^d$ onto $\mathbb R^d$ and $\partial M$ is closed in $\mathbb R^d$, we know that $f(\partial M)$ is closed in $\mathbb R^d$ and hence (since $f(\partial M)\subseteq\partial M$) closed in $\partial M$. On the other hand, again since $f(\partial M)\subseteq\partial M$, we can show that $\left.f\right|_{\partial M}$ is an open map from $\partial M$ to $\partial M$ and hence $f(\partial M)$ is open in $\partial M$.

Since we have shown that $f(\partial M)$ is "clopen" in $\partial M$, the claim is immediate if $\partial M$ is connected. According to this answer, this is enough to conclude, since we can consider the "connected components" of $\partial M$ separately. What's precisely meant by that and how can show this rigorously?

EDIT
I actually don't need to show the claim (which is wrong, as Lee Mosher has shown in his answer) for an arbitrary $f$. If $\tau>0$ and $v:[0,\tau]\times\mathbb R\to\mathbb R$ is continuous in the first argument and satisfies $$\sup_{t\in[0,\:\tau]}\left|v(t,x)-v(t,y)\right|\le c|x-y|\tag1$$ for some $c\ge0$, we know that, for all $x\in\mathbb R$, there is an unique $X^x\in C^0([0,\tau])$ with $$T_t(x):=X^x(t)=x+\int_0^tv(s,X^x(s))\:{\rm d}s\;\;\;\text{for all }t\in[0,\tau]\tag2.$$

I want to show that $T_t(\partial M)\subseteq\partial M)$ for all $t\in[0,\tau]$ already implies $T_t(\partial M)=\partial M)$ for all $t\in[0,\tau]$.


$^1$ This is, for example, the case when $M$ is a $d$-dimensional properly embedded $C^1$-submanifold of $\mathbb R^d$ with boundary, since then $\partial M$ coincides with the topological boundary of $M$. I actually wonder whether it's possible at all that $\partial M$ is closed in $\mathbb R^d$ if $k<d$. So, it would be great if someone could comment on that.
 A: As Lee Mosher pointed out, this is only true for flows, not for arbitrary diffeomorphisms.
Suppose $T_t$ is a global flow. Let $\partial_i M$ be an arbitrary connected component of $\partial M$. Choosing an arbitrary point $x_0\in \partial_i M$, the set $\{T_t(x_0): t\in [0,\tau]\}$ is a connected subset of $\partial M$, so it is contained in a single component. But when $t=0$, $T_t(x_0)=x_0\in \partial_i M$, so that component must be $\partial_i M$ itself.
Now for each $t\in [0,\tau]$, $T_t(\partial_i M)$ is a connected subset of $\partial M$ that has a point in common with $\partial_i M$, so it must be contained in $\partial_i M$. Then the open-closed argument you summarized shows that $T_t(\partial_i M) = \partial_i M$.
Now do you see why it matters that we're talking about a flow and not just an arbitrary diffeomorphism?
A: Here is a counterexample:

*

*$k=d=1$

*$M=\bigcup_{i=0}^\infty \,\, [i,i+\frac{1}{2}]$

*$f(x)=x+1$
The context of this linked answer is different: it is about flows; whereas your question is about diffeomorphisms.
