Your degree is a chance for expansion

Let $X$ and $Y$ be compact oriented smooth manifolds of the same dimension, with $Y$ connected. Let $f : X \to Y$ be a smooth function. Take $y \in Y$ a regular value of $f$ and, for $x \in f^{-1}(y)$, define $o(x)$ as $+1$ if $f$ preserves orientation at $x$ and as $-1$ if it reverses the orientation. We define the degree of $f$ as the number $d(f) = \sum_{x\in f^{-1}(y)}o(x)$.

Prove the following extension theorem: Assume $Y=S^k$ is a $k$-dimensional sphere and $X=\partial W$ is the boundary of a compact oriented $(k+1)$-manifold $W$. There exists a smooth extension $F:W\to Y$ of $f$ if and only if $d(f)=0$.

For an embedded compact 3-manifold $M \subseteq \mathbb{R}^3$, $H_1(M)=0$ implies $\pi_1(M)=0$.