TITLE: Extending morphisms between varieties
QUESTION [5 upvotes]: This is Exercise 5.8 from Gathmann's notes on Algebraic Geometry, and I'm having a bit of trouble for (a) and (b): page 41 of http://www.mathematik.uni-kl.de/~gathmann/class/alggeom-2014/main.pdf
(a) asks you to show that any morphism $f:\mathbb{A}^1\backslash \{0\}\rightarrow\mathbb{P}^1$ can be extended to a morphism from $\mathbb{A}^1$ to $\mathbb{P}^1$.
(b) asks you to show that not all morphisms $f:\mathbb{A}^2\backslash \{(0,0)\}\rightarrow\mathbb{P}^1$ can be extended to a morphism from $\mathbb{A}^2$ to $\mathbb{P}^1$.
I suspect for (b) that the morphism that takes $(x,y)$ to $(x:y)$ can't be extended, but I'm not exactly sure how to prove this. Also, is the fact that $\mathcal{O}_{\mathbb{A}^2}(\mathbb{A}^2\backslash \{(0,0)\})=\mathcal{O}_{\mathbb{A}^2}(\mathbb{A}^2)$ useful in any way?
I would prefer to have an answer that doesn't involves schemes or anything too advanced like that.

REPLY [5 votes]: Let $\phi: k^2 \setminus \{(0,0)\} \rightarrow \mathbb{P}^1$ be the map $\phi(x,y) = \overline{(x,y)}$.  If you try to extend $\phi$ to a map $k^2 \rightarrow \mathbb{P}^1$, it won't even be continuous.  
Suppose $\phi$ did extend to a function on $k^2$.  Let $U_0 = \{ \overline{(x,y)} \in \mathbb{P}^1 : x \neq 0\}$, and similarly define $U_1$. Then $U_0, U_1$ form an open cover $\mathbb{P}^1$.  Suppose that $\phi(0,0)$ lies in $U_0$.  Then the preimage of $U_0$ is $$\{ (x,y) \in k^2 : x \neq 0 \} \cup \{(0,0) \}$$ whose complement in $k^2$ is $$E = \{ (0,y) : y \neq 0\}$$ Now $E$ should be closed in $k^2$.  But notice $E$ is contained in $\{0\} \times k$, a closed set in $k^2$ which is homeomorphic to the affine line $k$ via $(0,y) \mapsto y$.  The image of $E$ in $k$ should then be closed in $k$.  But closed sets in $k$ are either finite sets or the whole space, contradiction.