Suppose $(X,O_X)$ and $(Y, O_Y)$ are ringed spaces, and let $X = U_1 \cup U_2$ be an open cover. Suppose we have morphism of ringed spaces $\pi_i: U_i \rightarrow Y$ such that they agree on the overlap. I want to show that there is a unique morphism of ringed spaces $\pi: X \rightarrow Y$ such that $\pi|_{U_i} = \pi_i$.
I was able to show that the continuous map between $X$ and $Y$, but I am having trouble defining the map between the structure sheaves. I appreciate any help! Thank you!
PS I would also appreciate if someone could explain me exactly what it means to "agree on the overlaps", what does this mean for the map of sheaves of the ringed space morphism?