Suppose we have sheaves $\mathcal{F},\mathcal{G}$ on a topological space $X$ where $\mathcal{U}$ is a base of $X$. Then to define a morphism $\varphi:\mathcal{F}\rightarrow \mathcal{G}$, is it enough to define $\varphi(U): \mathcal{F}(U)\rightarrow \mathcal{G}(U)$ for each $U\in \mathcal{U}$? If so, if each defined $\varphi(U)$ is further an isomorphism, is $\varphi$ necessarily an isomorphism of sheaves?
These questions were kind of motivated by proofs of the isomorphism $(D(f), \mathcal{O}_X|_{D(f)})\cong (\operatorname{Spec}A_f, \mathcal{O}_{\operatorname{Spec}_{A_f}})$ I read. It seems to me that when constructing the isomorphism of sheaves, people are only showing that they can define isomorphism of sections of these two sheaves on "basic opens" without constructing the general morphism of sheaves.