# About a regular value of a manifold with boundary

I don't understand the proof of the following theorem.

Thorem: Let $f:X→N$ be a smooth mapping, where $X$ is $m$ dimensional smooth manifold with boundary and $N$ is $n$ dimensional smooth manifold. Moreover, $m≥n$. If $y∈N$ is a regular value, both for $f$ and the restriction $f|_{∂X}$, then $f^{−1}(y)⊂X$ is a smooth $(m−n)$ manifold with boundary. Furthermore the boundary $∂(f^{−1}(y))$ is precisely equal to the intersection of $f^{−1}(y)$ with $∂X$.

(Proof) Assume that $X=H^m$($H^m= \{(x_1,...,x_m)\in\mathbb{R}^m|x_m \ge 0\}$) and $N=\mathbb{R}^n$.Let $x \in f^{-1}(y)$.Suppose that $x$ is a boundary point.Choose a smooth map $g:U \to \mathbb{R}^n$ that is defined throughout a neighborhood of $x \in \mathbb{R}^m$ and coincides with $f$ on $U \cap H^m$.Replacing $U$ by a smaller neighborhood if necessary , we may assume that $g$ has no critical points. ...

Why,we assume that $g$ has no critical points?(How do we take "$U$"?) Could you teach me about this statement?