Section of unions of open subschemes I'm stuck at a line in Hartshorne's text (p.g. 82). Could someone help me please?
Fact. Suppose that $X$ is a scheme having $U$ and $V$ as two non-empty disjoint open subsets of $X$. Then $\mathcal{O}_X(U \cup V) = \mathcal{O}(U) \times \mathcal{O}_X(V)$.
I know how to prove this when $X$ is affine, but I don't know how to reduce the general case to this affine case. The fact sounds intuitively reasonable: since $U$ and $V$ are disjoint, a "function" is defined on $U \cup V$ iff it is defined independently on $U$ and on $V$. However, I can't prove this rigorously, since I'm stuck at the first difficulty with algebraic geometry using scheme language: no formula for $\mathcal{O}_X(U)$! It would be nice to know a rigorous of this fact. Thanks!

There is a canonical homomorphism $(\rho^{U\cup V}_U, \rho^{U\cup V}_V) : \Gamma(U\cup V) \to \Gamma(U) \times \Gamma(V)$ induced by the restriction homomorphisms.  This being an isomorphism follows directly from the fact that the structure sheaf is a sheaf: injectivity is precisely the fact that a section of $U \cup V$ restricts to 0 on both $U$ and $V$ iff it is 0 on the union; and surjectivity is precisely the fact that two sections on U and V respectively can be lifted to the union (since they agree trivially on the intersection).
