Smooth map between smooth manifold and boundary of manifold This is my first question here so I'm asking for your understanding. I also apologize in advance for my English.
I'm beginner on smooth manifolds topics and I can't solve the following problem. 
Let $f$:$M\rightarrow N$ be smooth map between smooth manifolds. Let's assume that $im (f) \subseteq \partial N$. Prove that $f$ considered as map $M \to \partial N$ is smooth. 
I would like to know how to prove it formally.
My attempt:
Let $(U,\varphi)$ and $(V,\psi)$ be smooth charts. I know that $\psi \circ f \circ \varphi^{-1}$ is smooth on its domain. I want to show that for chart $(W, \theta)$, where $W = V \cap \partial N$ and $\theta = \psi|_{W}$, the composition $\theta \circ f \circ \varphi^{-1}$ is smooth, but I do not know how. 
I will be really grateful for any help. 
 A: The proof is a follow-your-nose manipulation of the definitions of charts for $M$, $N$ and $\partial N$.
Let $m = \text{dimension}(M)$ and $n = \text{dimension}(N)$. 
Let $x \in M$ and $y=f(x) \in \partial N$. We want to prove that $f : M \to N$ is smooth at $x$ if and only if $f : M \to \partial N$ is smooth at $x$. Since smoothness is independent of charts, it suffices to construct particular charts $(U,\phi)$ of $M$ at $x$, $(V,\psi)$ of $N$ at $y$, and $(W,\theta)$ of $\partial N$ at $y$, such that $f(W) \subset U \cap V$, and such that the map $\psi \circ f \circ \phi^{-1}$ is smooth if and only if the map $\theta \circ f \circ \phi^{-1}$ is smooth.
Start with an arbitrary chart of $N$ near $y$, given by $\psi : V \to \mathbb H^n$ where $\mathbb H^n = \{(t_1,...,t_{n-1},t_n) \in \mathbb R^n \mid t_n \ge 0\}$. Let $W = \partial N \cap g^{-1}(V)$. Let $\pi : \mathbb H^n \to \mathbb R^{n-1}$ be the projection given by $\pi(t_1,...,t_{n-1},t_n) = (t_1,...,t_{n-1})$. Let $\theta : W \to \mathbb R^{n-1}$ be given by $\theta = \pi_n \circ g$. As a consequence of the definition of the boundary it follows that $\theta$ is a chart of $\partial N$ near $y$.
Now consider a chart of $M$ near $x$, given by $\phi : U \to \mathbb R^m$. We may assume that $U \subset \theta^{-1}(W)$, by replacing $U$ with $U \cap \theta^{-1}(W)$. It also follows that $U \subset \psi^{-1}(V)$. 
We may write the local expression for $f$ using the $U$ and $V$ coordinates as
$$\psi \circ f \circ \phi^{-1}(x_1,...,x_m) = (f_1(x_1),...,f_{n-1}(x_1,...,x_m),f_n(x_1,...,x_m))
$$
but notice that since $f(M) \subset \partial N$ we must have $f_n(x_1,...,x_m)=0$. Therefore, we may simplify the above formula to
$$\psi \circ f \circ \phi^{-1}(x_1,...,x_m) = (f_1(x_1),...,f_{n-1}(x_1,...,x_m),0)
$$
By composing with the projection map $\pi$, it follows that the local expression for $f$ using the $U$ and $W$ charts is given by
$$\theta \circ f \circ \phi^{-1}(x_1,...,x_m) = (f_1(x_1,...,x_m),...,f_{n-1}(x_1,...,x_m))
$$
It follows that $\psi \circ f \circ \phi^{-1}$ is smooth if and only if the functions $f_1,...,f_{n-1}$ are smooth if and only $\theta \circ f \circ \phi^{-1}$ is smooth.
