I've been stuck on Exercise II.1.21(e) from Hartshorne's book for quite a while. It concerns the projective line $\mathbb{P}^1$ over an algebraically closed field $k$: write $\mathscr{H}$ for the constant sheaf with values in the function field $K$ and $\mathcal{O}$ for the structure sheaf. The content of the exercise is that map on global sections $\Gamma(X,\mathscr{H}) \to \Gamma(X,\mathscr{H}/\mathcal{O})$ is surjective. In the previous subexercise one shows that $\mathscr{H}/\mathcal{O} \cong \bigoplus_{p \in \mathbb{P}^1} i_p(K/\mathcal{O}_p)$ where $i_p$ is the skyscraper sheaf construction at $p$.
So the following will suffice: given $f \in K$ and $p \in \mathbb{P}^1$, we need to produce $g \in K$ such that $f - g \in \mathcal{O}_p$ and $g \in \mathcal{O}_q$ for all $q \neq p$. But I'm at a loss as to how to do such a thing. I assume the first step is to remove some point besides $p$, so $\mathbb{A}^1 \subset \mathbb{P}^1$ is what's left over, and write $f$ explicitly in terms of the coordinate on $\mathbb{A}^1$. Could someone point me in the right direction? I would especially grateful for a more conceptual/less ad hoc hint or explanation.