Problem 2.9 in Lee's Smooth Manifolds: finding a map between complex projective spaces that makes the diagram commutative 
Given a polynomial $p$ in one variable with complex coefficients, not identically zero, show that there is a unique smooth map $\widetilde p : \mathbb C \mathbb P^1 \to \mathbb C \mathbb P^1$ (complex projective space) sucht that the following diagram commutes, where $G: \mathbb C \to \mathbb C \mathbb P^1$ is given by $G(z) = G(x, y) = [x, y, 1, 0]$ (identifying $[z] \leftrightarrow (x, y)$, as in problem 1.9 of the same book):
$\require{AMScd}$
\begin{CD}
\mathbb C @>G>> \mathbb C \mathbb P^1\\
@V p V V @VV \widetilde p V\\
\mathbb C @>>G> \mathbb C \mathbb P^1
\end{CD}

What I have done:
We know $p$:
$$
p(z) = a_0 + a_1 z + \ldots a_n z^n, \quad z = x + iy \in \mathbb C.
$$
Therefore, we can obtain an expression for $\widetilde p|_{G(\mathbb C)}$:
$$
\widetilde p \circ G(x + iy) = \widetilde p([x, y, 1, 0]) = G(p(z)) = [\text{Re} (p(z)), \text{Im} (p(z)), 1, 0],
$$
which can be given in terms of the coefficients $a_i$ of the polynomial $p$, $x$ and $y$: both $\text{Re}(p(z))$ and $\text{Im}(p(z))$ are polynomials in the two real variables $x$ and $y$ and whose coefficients are in terms of the coefficients $a_i$ of $p$.
Now, my I am a bit lost. Should we define $\widetilde p$ on the whole space $\mathbb C \mathbb P^1$ or only on the image of $G$? If it is the latter, we can write an expression for $\widetilde p$ depending only on the coefficients of $p$ and $x, y$, and it only remains to show smoothness (which I believe follows easily once one writes the coordinate representation of $\widetilde p$). If not, how to proceed?
Thanks in advance.
EDIT
From the previous exercise we learn that the image of $G$ is an open dense subset of $\mathbb C \mathbb P^1$. Then we can extend $\widetilde p$ in an unique way to the whole $\mathbb C \mathbb P^1$, by smoothness, and we are done. Correct?
 A: We can get by with simpler notation by using only pairs of complex numbers, say $[Z : W]$ with $(Z, W) \neq (0, 0)$, and writing $z = Z/W$ if $W \neq 0$ an $w = W/Z$ if $Z \neq 0$.
Clearly we're obliged to define $\widetilde{p}\bigl([z : 1]\bigr) = [p(z) : 1]$ for complex $z$. The issue is then to show this mapping extends to the point $[1 : 0]$ at infinity, as you surmise. For that, one standard idiom is to write $z = 1/w$ and multiply through by a suitable power of $w$ to get $\widetilde{p}\bigl([1 : w]\bigr) = [1 : q(w)]$ for some polynomial $q$.
A: Let $U_1 = \{[z:w] \in \mathbb {CP}^1 \mid z \ne 0 \} = \mathbb {CP}^1 \setminus \{[0:1]\}$ and $U_2 = \{[z:w] \in \mathbb {CP}^1\mid w \ne 0 \}= \mathbb {CP}^1 \setminus \{[1:0]\}$. Note that this shows that $\mathbb {CP}^1$ is the one-point compactification of both $U_1, U_2$.
The smooth structure on $\mathbb {CP}^1$ is given by the two charts
$$\phi_1 : U_1 \to \mathbb C, \phi_1([z:w]) = \frac{w}{z} \quad, \quad \phi_2 : U_2 \to \mathbb C, \phi_2([z:w]) = \frac{z}{w}.$$
Their inverses are
$$\phi_1^{-1} : \mathbb C \to U_1, \phi_1^{-1}(w) = [1:w] \quad, \quad \phi_2^{-1} : \mathbb C \to U_2, \phi_2^{-1}(z) = [z:1]$$
which reflects the fact that each element of $U_1$ resp. $U_2$ has a unique representative of the form $[1:w]$ resp. $[z:1]$. Note that $G = \phi_2^{-1}$.
As a homeomorphism $G$ has a unique extension to a homeomorphism $\bar G : \mathbb C^* \to \mathbb {CP}^1$. Here $\mathbb C^* = \mathbb C \cup \{\infty\}$ is the one-point compactification of $\mathbb C$. We have $\bar G(\infty) = [1:0]$.
$p$ induces the smooth map $p^* = \phi_2^{-1} \circ p \circ \phi_2 : U_2 \to U_2$ which is given by $p^*([z:1]) = [ p(z):1]$.
The case that $p$ has degree $0$ is trivial. The map $p^*$ is constant with value $[a_0:1]$. Hence it has a unique smooth extension $\bar p : \mathbb {CP}^1 \to \mathbb {CP}^1$ which is the constant map with vaule $[a_0:1]$.
So let assume that $p$ has degree $n \ge 1$. It is well-known that $p(z) \to \infty$ as $z \to \infty$, thus $p$ has a unique continuous extension $\tilde p : \mathbb C^*  \to \mathbb C^*$. Via $\bar G$ this gives us a unique continuous extension $\bar p : \mathbb {CP}^1  \to \mathbb {CP}^1$ of $p^*$. We have $\bar p([1:0]) = [1:0]$. It remains to show that it is smooth.
Let $U(\rho) \subset \mathbb C$ denote the open disk with center $0$ and radius $\rho > 0$. The polynomial $p$ has finitely many zeros  which are contained in some $U(r)$. The set $V_1 = \phi_1^{-1}(U(\frac{1}{r}))$ is an open neigborhood of $[1:0]$ in $U_1$, hence $V_1 \setminus \{[1:0]\} \subset U_2$. Let $[1:w] \in V_1 \setminus \{[1:0]\}$. Then $w \in U(\frac{1}{r}) \setminus \{0\}$ and therefore $\frac{1}{w} \notin U(r)$ which implies $p(\frac{1}{w}) \ne 0$. Hence $p^*([1:w]) = p^*([\frac{1}{w}:1]) = [p(\frac{1}{w}):1] \ne [0:1]$, i.e. we get $p^*(V_1 \setminus \{[1:0]\}) \subset U_1$. Hence $\bar p(V_1) \subset U_1$. It therefore suffices to show that $q : V_1 \stackrel{\bar p}{\to} U_1$ is smooth which is equivalent to the smoothness of
$$q^* : U(\frac{1}{r}) \stackrel{\phi_1^{-1}}{\to} V_1 \stackrel{q}{\to} U_1 \stackrel{\phi_1}{\to} \mathbb C .$$
But clearly $q^*(0) = \phi_1(\bar p([1:0])) = \phi_1([1:0]) = 0$ and $q^*(w) = \phi_1(\bar p([1:w])) = \phi_1(p^*([1:w])) = \phi_1(p^*([\frac{1}{w}:1])) =  \phi_1([p(\frac{1}{w}):1]) = \dfrac{1}{p(\frac{1}{w})}$ for $w \ne 0$. Recall that $\frac{1}{w} \notin U(r)$ for $w \in U(\frac{1}{r}) \setminus \{0\}$, thus $p(\frac{1}{w}) \ne 0$.
Define a polynomial $r$ by
$$r(w) = a_0w^n + a_1w^{n-1}+\dots+ a_{n-1}w + a_n.$$
Then $$\dfrac{1}{p(\frac{1}{w})} = \dfrac{w^n}{r(w)} .$$
Hence on all of $U(\frac{1}{r})$
$$q^*(w) = \dfrac{w^n}{r(w)}$$
which is clearly smooth.
