Definition of smooth point and its practical application My book defines a smooth point of the boundary of a subset of a manifold as follows. Let $X\subset M\subset\mathbb{R}^n$ where $M$ is a $k$-dimensional manifold. Consider a point $\vec{x}\in\partial_MX$, the boundary between $X$ and $M$. This point is a smooth point if there exists a neighborhood $V\subset\mathbb{R}^n$ of $\vec{x}$ and a single $C^1$ function $g\colon V\cap M\to\mathbb{R}$ such that
$$g(\vec{x})=0,\quad X\cap V=\{g\geq0\},\quad \text{and }[Dg(\vec{x})]\colon T_{\vec{x}}M\to\mathbb{R}\, \text{is surjective.}$$
$[Dg(\vec{x})]$ is the derivative (the Jacobian) of $g$ at $\vec{x}$ and $T_{\vec{x}}M$ is the tangent space of $M$ at $\vec{x}$.
My first question is, why must the derivative be surjective? Furthermore, why does the derivative of $g$ map from the tangent space of $M$ at $\vec{x}$ instead of $V\cap M$ (which is the domain of $g$)?
My second question is best phrased with an example: consider the region bounded by the graphs of $y=x^2$ and $x=y^2$. Apparently, the origin and $(1,1)$ are not smooth points of the boundary. How so? This is stated without proof, but the nonexistence of a function $g$ for those points is not clear to me.
 A: This definition is given in order to apply the Implicit Function Theorem:
If $M,N$ are smooth manifolds and $g\colon M \to N$ with $g(x)=0$ is a smooth ($C^1$ is enough) function and if $dg_x \colon T_xM \to T_{g(x)}N$ is surjective, then there exists a neighborhood $U$ of $x$ such that $U \cap \{g=0\}$ is an embedded smooth (or $C^1$, depending on the smoothness of $g$) submanifold of $M$ of dimension $\dim M - \dim N$. In your case, since $N=\mathbb{R}$, the dimension of the submanifold is $\dim M - 1$, so it is a hypersurface
The meaning of your definition of smooth point of the boundary of $X$ is that locally at $x$, your set $X$ is written as a sub-graph of a smooth function ($\{g \geq 0\}$) and $\partial X = \partial \{g \geq 0\} = \{g=0\}$ is a smooth hypersuface.
The surjectivity is important to obtain that $\partial X$ is of dimension $\dim M - 1$: if $M= \mathbb{R}$ and $g \colon \mathbb{R} \to \mathbb{R}$ is such that $g(x)=0$, the hypothesis that $dg_x$ is surjective means that $g'(x) \neq 0$. This implies that in a neighborhood of $x$ you have $\{g=0\}= \{x\}$ which is a submanifold of dimension $0$. If $g'(x)=0$ you may have the set $\{g=0\}$ to be even an interval.
Intuitively, the differential is an application between tangent spaces because it maps tangent vectors to $M$ into tangent vectors to $N$: take a tangent vector $v$ to $M$ at $x$ and pick a curve on $M$ $\gamma \colon (-\varepsilon, \varepsilon) \to M$ which passes through $x$ in direction $v$, that is such that $\gamma(0)=x$ and $\gamma'(0)=v$. Then $g \circ \gamma$ is a curve on $N$, whose tangent at $0$ is $dg_x(v)$.
Thus the differential maps tangent vectors to the domain into tangent vectors to the image.
In higher dimension, the surjectivity of the differential means that for every direction $w$ on $N$ you have a curve on $M$ which is mapped by $g$ into a curve whose tangent is $w$; since the differential is linear, this means that you have exactly $\dim M - \dim N$ independent directions on $M$ which are mapped into $0$; thus exactly in the linear span of these directions, "moving from $x$, $g$ does not change at the first order" and you expect that the set of zeros of $g$ is ($\dim M - \dim N$)-dimensional.
The answer to your second question is contained into the Implict Function Theorem: at the origin and $(1,1)$ the boundary of your set is not a smooth curve (you have different tangents on the left and on the right), thus such a $g$ cannot exist.
