Showing that compatible germs are the image of a section. I'm currently self-studying Ravi Vakil's Rising Sea. I have been stuck on exercise 2.4.C, which ask one to prove that any compatible germs is the image of a section. The following definition etc are all taken from the notes. If I have understood it correctly we have the map $$I : \mathscr{F}(U) \rightarrow \prod_{p \in U} \mathscr{F}_p$$ given by $ s \mapsto (\bar{s})_p$, i.e mapping a section to its germ in the respective points. Now germs $(s_p)$ are defined to be compatible if there exists a covering $\{U_i\}$ of $U$ and sections $f_i \in U_i$ such that the germ of $f_i$ for all $p \in U_i$ is $s_p$. I think that one is supposed to glue together the sections given in the definition of compatible germs, though I haven't been able to show that the given sections' restrictions are equal on the overlaps/intersections. Many thanks for any help or hint.
 A: Yeah, that's the approach you're supposed to take, I think.
Picking up where you left off, you want to show that, given two sections $f_i \in \mathscr F(U_i)$, $f_j \in \mathscr F(U_j)$, that they agree when restricted to $U_i \cap U_j$.
At any point $p \in U_i \cap U_j$, both $(f_i)\mid_{U_i \cap U_j}$ and $(f_j)\mid_{U_i \cap U_j}$ have the stalk $s_p$. But by 2 4.A, two sections being everywhere stalk-wise equal means that they are the same section.
A: Let $(s_p)_{p \in U} \in \prod_{p \in U} \mathscr F_p$ be a compatible germ. By definition, there exists a cover $\{U_i\}_{i \in I}$ for $U$, and elements $f_i \in \mathscr F(U_i)$ such that for all $q \in U_i$ we have $s_q = [f_i, U_i] \in \mathscr F_q$.
If $q \in U_i \cap U_j$, then $[f_i, U_i]=s_q=[f_j, U_j]$ in $\mathscr F_q$, hence $$[f_i|_{U_i \cap U_j}, U_i \cap U_j] = [f_j|_{U_i \cap U_j}, U_i \cap U_j] \in \mathscr F_q.$$
Since $q$ was arbitrary, this holds on all of $U_i \cap U_j$. Since $\mathscr F$ is a sheaf, the map $\mathscr F(U_i \cap U_j) \to \prod_{p \in U_i \cap U_j} \mathscr F_p$ is injective and thus we have $f_i|_{U_i \cap U_j}=f_j|_{U_i \cap U_j}$.
Since $\mathscr F$ is a sheaf, there exists a unique $f \in \mathscr F(U)$ such that $f|_{U_i} = f_i$. Therefore, the map $\mathscr F(U) \to \prod_{p \in U} \mathscr F_p$ takes $$f \mapsto ([f, U])_{p \in U} = ([f_i, U_i])_{p \in U} = (s_p)_{p \in U}.$$
