I want to prove the following statement:
Let $f:F \to G$ be a homomorphism of sheaves. Let $(U_i)_{i \in I}$ be an open coverage of $X$, such that $f|{U_i}: F|U_i \to G|U_i$ is an isomorphism for all $i$. Then $f$ is an isomorphism.
(A homomorphism of sheaves $f: F \to G$ is an indexed family $f = (f_U)_{U \subset X \text{ open}}$, $F(U) \to G(U)$, such that $$ \require{AMScd} \begin{CD} F(U) @>{f_U}>> G(U)\\ @VVV @VVV \\ F(V) @>{f_V}>> G(V) \end{CD} $$ is commutative ($V \subset U$ open). Isomorphism means: $f|_U$ is bijective for all $U$.)
What I tried
I looked at $$ \require{AMScd} \begin{CD} F(U) @>{f_U}>> G(U)\\ @VVV @VVV \\ F(U_i \cap U) @>{}>> G(U_i \cap U) \end{CD} $$ and $$ \require{AMScd} \begin{CD} F(U_i) @>{}>> G(U_i)\\ @VVV @VVV \\ F(U_i \cap U) @>{}>> G(U_i \cap U) \end{CD} $$
I picked $s,\tilde{s} \in F(U)$ with $s \neq \tilde{s}$ and tried to show $f_U(s) \neq f_U(\tilde{s})$ (for injective) by going through the diagrams. However, I failed. Same for surjective. Is this the right way to prove this?
The professor left this in the lecture unproved and I thought it is a good exercise to prove it since I'm not familiar with this yet. Also the professor claims that the statement is not true if $F,G$ are only presheaves. Is that true?
The proof should go like this:
You can test an homomorphism of sheaves to be an isomorphism by looking at the stalks at each point. If $x \in U_i \subset X$ is given, the induced map $F_x \to G_x$ does not depend on whether you derive it from $f$ or from $f_{|U_i}$.
Here is a counterexample for the presheaf-case: Take $X$ to be the union of two discrete points and $F$ to be the constant presheaf $\mathbb Z$ on $X$. Let $G$ be the associated sheaf. The natural map $F \to G$ is not an isomorphism of presheaves but an isomorphism on both points.