In Milnor's book "Topology from the Differentiable Viewpoint", He states the following lemma: Let $M, N$ be oriented $n$ manifolds, with $M$ compact and $N$ connected. Let $f : M \to N$ be a smooth map, and $y$ a regular value of $f$. Also, suppose $f$ can be extended to $F : X \to N$ where X is a compact oriented manifold with boundary M. Then $deg (f ; y) =0$.
I do not understand the proof given. He first proves it in the case when $y$ is a regular value of $F$. In this case, he claims that $F^{-1} (y) $ is a compact $1$ manifold with boundary and hence is the disjoint union of circles and line segments. He then claims that for any line segment, the sum of signs of the two boundary points is $0$ establishing the theorem. He then extends it to the other points by using the fact that it (the degree) is locally constant. I don't understand Milnor's proof of the claim.
Let $c\subset f^{-1}(y)$ be a segment, and let $p,q$ denote the two endpoints of $c$. Note that $p,q\in\partial X=M$. We equip $c$ with the orientation induced by $F$ and the orientations of $X$ and $N$. With no loss of generality, this orientation points inwards at $p$ and outwards at $q$. It follows that at $df_q$ carries an oriented basis of $T_qM$ to an oriented basis of $T_{f(q)}N$, whereas $d_pf$ carries an oriented basis of $T_pM$ to a non-oriented basis of $T_{f(p)}N$.