From Vakil's FOAG:
I have shown that there exists a morphism of ringed spaces $\pi: X \to Y$. This follows from gluing continuous maps between topological spaces and by the glueing axiom of sheaves.
More specifically, for any open $V \subset Y$, define $\pi^\sharp_V: \mathcal O_Y(V) \to \mathcal O_X(\pi^{-1}(V))$ via $f \mapsto g$ where $g$ is the unique element of $\mathcal O_X(\pi^{-1}(V))$ such that $$g|_{\pi^{-1}_i(V)} = \pi^\sharp_{i,V}(f).$$
Now, I am having trouble showing that $\pi|_{U_i} = \pi_i$ on the level of sheaves. This is obvious on the level of topological spaces. So, I believe the problem is showing that $$(\pi|_{U_i})^\sharp = \pi^\sharp_i$$ on the level of sheaves.
I could be mistaken on the notation of what we want to show. Any thoughts?
