This question comes from exercise I-10 of The Geometry of Schemes by Joe Harris (although this question is not about schemes). It is translated to less abstract language below:
Consider the Riemann sphere $\hat {\mathbb C} = \mathbb C \cup \{\infty\}.$ Find an example of an open set $U\subseteq \hat {\mathbb C}$ and an analytic function $f$ on $U$ such that $f$ cannot be written as a sum of two analytic functions $f_0 + f_{\infty},$ where $f_0$ vanishes at $0$ and $f_\infty$ vanishes at $\infty.$ (If $U$ does not include $0,$ then the "vanish at $0$" condition is vacuously true and $f_0$ can just be any analytic function on $U$. Similar for $\infty.$)
(The sheaf-theoretic version is this: Let $\mathcal F_0,\mathcal F_\infty$ be the sheaf of ring of analytic functions vanishing at $0, \infty.$ Let $\mathcal F = \mathcal F_0 \oplus \mathcal F_\infty,$ and define $\varphi: \mathcal F \to \mathcal A : (f_0, f_\infty )\mapsto f_0+ f_\infty,$ where $\mathcal A$ is the sheaf of analytic functions. Then although the morphism $\varphi$ is surjective at every stalk of $\mathcal F,$ it is not surjective for every open set $U,$ and the ring $\mathcal F(U).$ )
I am thinking about how to construct such an example. Let $U$ be an open set that contains both $0$ and $\infty,$ and let $m$ be a $C_c^\infty$ function supported in a compact neighborhood of $0.$ Then for any smooth $u$ vanishing at both $0$ and $\infty,$ we have $$ f= [mf+u] +[(1-m)f-u] $$ If we want both $[]$ to be analytic, then we need to satisfy the Cauchy-Riemann equation $$ \frac{\partial}{\partial \bar z} (mf+u) =0, \frac{\partial}{\partial \bar z} (-mf-u)=0. $$ For what I remember, the CR equation is quite nice (as square root of Laplacian), and a smooth solution for $u$ should exist with the boundary conditions. So such a decomposition $f_0 + f_{\infty}$ exists. For $U$ that does not contain both $0$ and $\infty,$ such a decomposition is is trivial.
So maybe the example I am looking for in the exercise does not exist? Is there a flaw in my argument?