In Munkres' Topology, the proof of theorem 62.3 goes as follows: Let $U$ be an open subset of $\mathbb{R}^2$ and let $f:U\rightarrow S^2$ be continuous and injective. Then let $B$ be any closed ball contained in $U$, and let $a,b$ be any two points of $S^2\setminus f(B)$. Then because the identity map $i:B\rightarrow B$ is nulhomotopic, the map $h:B\rightarrow S^2\setminus\{a,b\}$ which is a restriction of $f$ to $B$, is also nulhomotopic.
It seems like the last part ought to be true, since $h(B)$ would have to wrap around $a$ or $b$ to not be nulhomotopic, and then it would overlap with itself (since it's closed and thus compact), which is forbidden because $h$ is injective. But that seems like it would take more work to prove than the simple statement given in the book. Is there some theorem that the image of a compact nulhomotopic set is also nulhomotopic?
If two maps $i,j:X\to Y$ are homotopic, then for any $h:Y\to Z$, the compositions $hi$ and $hj$ are homotopic (since you can just compose $h$ with any homotopy $H:X\times I\to Y$ from $i$ to $j$ to get a homotopy $hH$ from $hi$ to $hj$). In this case, $X=Y=B$, $i$ is the identity map, and $j$ is a constant map. We conclude that $hi$ and $hj$ are homotopic. But $hi=h$ since $i$ is the identity, and $hj$ is a constant map because $j$ is constant. Thus $h$ is homotopic to a constant map.
More generally, by the same argument, if $X$ is a space such that the identity $X\to X$ is nullhomotopic, then every map out of $X$ is nullhomotopic. By a similar argument, you can also show that every map into $X$ is nullhomotopic. Such a space $X$ is called contractible.
(Note that we did not need the fact that $h$ is injective! If $h$ is not injective, the image $h(B)$ might wrap around $a$ or $b$ and not be contractible; however, the map $h$ itself is still nullhomotopic, because a homotopy is allowed to "unwrap" the parts where the image of $h$ intersects itself.)