[step:Compute the local contribution on each component by change of variables]Choose a unit-integral top form $\omega_0 \in \Omega^n(S^n)$ that is **supported in** $B$ — this is possible because $B$ is a nonempty open subset of $S^n$ and the standard volume form can be multiplied by a smooth bump that is positive in $B$ and zero outside, then rescaled to total mass $1$. By Step 1 (independence of representative), this choice does not change $\deg(f)$.
Since $f^*\omega_0$ is supported in $f^{-1}(\operatorname{supp} \omega_0) \subset f^{-1}(B) = \bigsqcup_{k=1}^N U_k$,
\begin{align*}
\deg(f) = \int_{S^n} f^*\omega_0 = \sum_{k=1}^N \int_{U_k} f^*\omega_0.
\end{align*}
Fix $k$. The restriction $f|_{U_k}: U_k \to B$ is a diffeomorphism. Choose oriented charts $\varphi: U_k \to \widetilde U_k \subset \mathbb{R}^n$ (induced from the orientation of $S^n$ at $x_k$) and $\psi: B \to \widetilde B \subset \mathbb{R}^n$ (induced at $y$); the transition map $F_k := \psi \circ f \circ \varphi^{-1}: \widetilde U_k \to \widetilde B$ is a diffeomorphism between open subsets of $\mathbb{R}^n$. Write $\omega_0|_B = u \cdot dy_1 \wedge \cdots \wedge dy_n$ pulled back through $\psi$ — more precisely, $(\psi^{-1})^*\omega_0 = \tilde u(y) \, dy_1 \wedge \cdots \wedge dy_n$ on $\widetilde B$, where $\tilde u: \widetilde B \to \mathbb{R}$ is smooth with $\int_{\widetilde B} \tilde u \, d\mathcal{L}^n(y) = \int_B \omega_0 = \int_{S^n} \omega_0 = 1$.
Pulling back by $F_k$:
\begin{align*}
F_k^*\bigl(\tilde u(y) \, dy_1 \wedge \cdots \wedge dy_n\bigr) = \tilde u(F_k(x)) \, \det(JF_{k,x}) \, dx_1 \wedge \cdots \wedge dx_n,
\end{align*}
where $JF_{k,x} \in \mathbb{R}^{n \times n}$ is the Jacobian matrix of $F_k$ at $x$. Integrating against the chart orientation,
\begin{align*}
\int_{U_k} f^*\omega_0 &= \int_{\widetilde U_k} \tilde u(F_k(x)) \, \det(JF_{k,x}) \, d\mathcal{L}^n(x).
\end{align*}
Since $F_k$ is a diffeomorphism and $\widetilde U_k$ is connected (it is the image of a connected $U_k$ under a chart; choose $U_k$ connected from the outset by replacing it with the connected component of $f^{-1}(B)$ containing $x_k$, which is again open and diffeomorphic to $B$ via $f$), the continuous nonvanishing function $\det(JF_{k,x})$ has constant sign on $\widetilde U_k$. Denote this sign by $\varepsilon_k := \operatorname{sgn}(\det Jf_{x_k}) \in \{+1, -1\}$ — it agrees with the sign at the single point $x_k$ because the charts are oriented and the transition functions between oriented charts have positive Jacobian determinant.
Apply the [Change of Variables (general)](/theorems/22) theorem to the diffeomorphism $F_k: \widetilde U_k \to \widetilde B$ between open subsets of $\mathbb{R}^n$, with integrand $\tilde u$ on $\widetilde B$. The hypotheses are met: $F_k$ is a $C^1$-diffeomorphism (in fact smooth), the integrand $\tilde u$ is Borel measurable (smooth, in particular continuous), and the change-of-variables identity $\int_{\widetilde B} \tilde u \, d\mathcal{L}^n = \int_{\widetilde U_k} \tilde u \circ F_k \cdot |\det JF_k| \, d\mathcal{L}^n$ holds. Combining with the sign $\varepsilon_k = \det(JF_{k,x})/|\det(JF_{k,x})|$ (constant on $\widetilde U_k$):
\begin{align*}
\int_{U_k} f^*\omega_0 &= \int_{\widetilde U_k} \tilde u(F_k(x)) \, \det(JF_{k,x}) \, d\mathcal{L}^n(x) \\
&= \varepsilon_k \int_{\widetilde U_k} \tilde u(F_k(x)) \, |\det(JF_{k,x})| \, d\mathcal{L}^n(x) \\
&= \varepsilon_k \int_{\widetilde B} \tilde u(y) \, d\mathcal{L}^n(y) \\
&= \varepsilon_k \cdot 1 = \operatorname{sgn}(\det Jf_{x_k}).
\end{align*}[/step]