Exactness can be checked on stalks I'm working through Vakil's notes about algebraic geometry right now, still in the first chapters, and one of the main results in section 2.5 is, that "Exactness of sequences can be checked on stalks". Then one shows that taking the stalk at a point $p$ is an exact functor. But what does that sentence mean? Sure, if have a exact sequence of sheaves I will get a exact sequence of stalks. But what about the other direction? Sure, taking stalks and taking images and kernels and whatnot commute, but how do we get that for example if $ker(\phi)_p=im(\psi)_p$ holds for all $p$ that also $ker(\phi)=im(\psi)$ is true in the category of sheaves? I'm hesitant because he writes in his notes before that an isomorphism on all stalks doesn't imply an isomorphism of the sheaves.
Maybe it's a naive question but I'm still very new to the subject. A somewhat related question: What about the 'taking sections over $U$'- functor? Since this is left-exact, can i somehow also check left-exact sequences on sections?
Glad for any advice! 
 A: This is something to be concerned about; it's not true in full generality!
It turns out that the category of sheaves on a topological space satisfies an important technical condition: it has "enough points".
A topos is said to have enough points if, for every $f : X \to Y$, the following are equivalent:


*

*$f$ is an isomorphism

*$f_p$ is an isomorphism for every point $p$


Here is the relevant page from the Stacks project.

Regarding your comment

I'm hesitant because he writes in his notes before that an isomorphism on all stalks doesn't imply an isomorphism of the sheaves.

I assume you're subtly misinterpreting his statement. What is possible is that you have two sheaves $F$ and $G$ on a topological space such that:


*

*$F_p$ and $G_p$ are isomorphic for every point $p$

*$F$ and $G$ are not isomorphic


The key point is that the hypothesis here is merely the assertion "there exists an isomorphism" for each $p$. This is much weaker than "the specific morphism $f_p$ is an isomorphism".

Checking left exactness by taking sections follows from the facts:


*

*Limits (and colimits) of presheaves are computed pointwise

*Limits of sheaves can be computed as presheaves


Letting $\mathbf{a}: \mathrm{PSh} \to \mathrm{Sh}$ be sheafification (which is left exact) and $\mathbf{i} : \mathrm{Sh} \to \mathrm{PSh}$ be the forgetful functor (which is left continuous), we have for any finite diagram $F : J \to \mathrm{Sh}$:
$$ \lim_j F_j = \lim_j \mathbf{ai}F_j
= a \left( \lim_j \mathbf{i}F_j \right)$$
and the presheaf is computed pointwise by
$$ \left( \lim_j \mathbf{i}F_j \right)(U)
=  \left( \lim_j \mathbf{i}F_j(U) \right) $$
Of course, $\mathbf{i}F_j(U) = F_j(U)$ if your site is subcanonical; i.e. if representable presheaves are sheaves. But I'll continue stating things in the general case.
So if you have a cone $L \to F$ with the property that $\mathbf{i}L(U) \to \mathbf{i}F(U)$ is a limit cone for every $U$, then $\mathbf{i}L \to \mathbf{i}F$ is a limit cone, and thus $L \to F$ is a limit cone.
A: This is an old question, but I am working through Vakil's and was having the same issue. There should have been an exercise along the line

Show that a sequence $0\to \mathcal K\to \mathcal F \to \mathcal Q\to 0$ of sheaves is exact if and only if $0 \to \mathcal K_p \to \mathcal F_p\to \mathcal Q_p \to 0$ is exact for every $p$.

The exercises in the notes do only ask you to do the "only if" part. If you are working through Vakil's notes at the moment, spoiler allert. Go back and check the other direction. I will now show my solution.
First note that the stalk at $p$ can be computed in two steps. Each sheaf $\mathcal F$ is a functor. First you restrict this functor to the full subcategory of all open sets which contain $p$. Then you take the colimit of the resulting functor.
Take an short exact exact sequence of sheaves $0\to \mathcal K\to \mathcal F \to \mathcal Q\to 0$. Put this exact sequence into the presheaf category. It will not be exact anymore, but there will be a presheaf $\mathcal Q'$ such that $0 \to \mathcal K \to \mathcal F  \to \mathcal Q' \to 0$ is a short exact sequence of presheaves. $\mathcal Q$ is the sheafification of $\mathcal Q'$ and in particular some sheafification arrow $\mathcal Q' \to \mathcal Q$ will be compatible with the maps $\mathcal F \to \mathcal Q$ and $\mathcal F \to \mathcal Q'$ by virtue of how cokernels of sheaves are constructed. It looks like this:

We are at the moment in the category of presheaves. The sequence we started with is no longer exact. Next restrict all the functors to the full subcategory of those open sets which contain $p$. Restriction is an exact functor, because limits and colimits in both functor categories are computed objectwise. Next take the colimit to get the stalks. It is a colimit over a filtered category, and hence exact. We get the following diagram:

The marked sequence is exact. The sheafification map induces isomorphisms on stalks by another exercise in Vakil's notes. Hence we see that also $0 \to \mathcal K_p \to \mathcal F_p\to \mathcal Q_p \to 0$ is exact. This is the direction which is taken care of in the notes. Now the other direction.
Let's first do cokernels. Assume a sequence $\mathcal F \to \mathcal G \to \mathcal Q \to 0$ of sheaves satisfies that $\mathcal F_p \to \mathcal G_p\to \mathcal Q_p \to 0$ is exact for each $p$. We don't know yet that $\mathcal G \to \mathcal Q$ is the cokernel of $\mathcal F\to \mathcal G$. But we now that there is some cokernel $\mathcal G \to \mathcal Q'$. The composition $\mathcal G \to \mathcal Q$ is zero on the level of stalks, and since maps of sheaves are determined by their action on stalks, it follows that $\mathcal F\to \mathcal Q$ is zero. Hence by the universal property of cokernels we get a map $\mathcal Q' \to \mathcal Q$. We wuld like to show that this map is an isomorphism, then we are done. By another exercise it is enough to show that this map is an isomophism on the level of stalks. So go to the level of stalks. By assumption and the previous part both marked sequences in

are exact, so the map $\mathcal Q'_p \to \mathcal Q_p$ must be an isomorphism. $\mathcal F\to \mathcal G\to \mathcal Q \to 0$ is exact as claimed.
A: I occurred to this question when reading Vakil's book too. I think the statement "exactness of a sequence of sheaves may be checked at the level of stalks" not only hold to short exact sequence but also long exact sequence too, i.e.:

$\mathscr{F} \xrightarrow{\phi} \mathscr{G} \xrightarrow{\varphi} \mathscr{H}$ is exact if and only if $\mathscr{F}_p \xrightarrow{\phi} \mathscr{G}_p \xrightarrow{\varphi} \mathscr{H}_p$ is exact for all $p \in X$

Using the concrete form of sections of kernel, cokernel and image from here(not quite sure about it, but anyway, I decided to write this answer down), maybe this proof by hand here is similar to Exact sequence of sheaves if and only if exact on the stalks :
Since for any open set $U$,
$$
(im\phi)(U) = \{(g_p \in \mathscr{G}_p)_{p \in U} | (g_p)_{p \in U} \text{ compatible} \text{ such that } g_p \in im\phi_p\}
$$
and
$$
(ker\varphi)(U) = \{(g_p \in \mathscr{G_p})_{p \in U} | (g_p)_{p \in U} \text{ compatible such that } g_p \in ker\varphi_p\}
$$
and $im\phi_p =ker\varphi_p$ for all $p \in X$, we have $(im\phi)(U) = (ker\varphi)(U)$. Therefore $im\phi = ker\varphi$.$\square$
