That categorical definition is for pre-sheaves, the topological definition is for sheaves.
In topological pre-sheaves, a map is surjective if it is epimorphic for each open set $U$ in $X$.
In topological sheaves, however, we instead have to "sheaf-ify" the definition, and we say that the map is "surjective" if the sheaf-ification of the cokernel map is zero.
Basically, in both cases, you have two categories, $\mathcal{Sh}$ and $\mathcal{PSh}$, and in $\mathcal{PSh}$, the "surjective" maps are the ones that are epimorphisms on each $U$, but in the $\mathcal{Sh}$ catageory, you have a more complicated definition of "surjective" (or "epimorphism.")
Consider, instead, two categories, $\mathcal{Ab}$ the category of abelian groups, and $\mathcal{AbTF}$, the full subcategory of "torsion-free" abelian groups - that is, the abelian groups, $A$, where for any $n\in\mathbb Z$ and $a\in A$, $na=0$ iff $n=0$ or $a=0$.
There is the natural inclusion functor $\mathcal{AbTF}\to\mathcal{Ab}$ and a natural adjoint sending $A\to A/N(A)$ where $N(A)$ is the subgroup of nilpotent elements of $A$.
But in $\mathcal{AbTF}$, the "epimorphisms" are not the ones with cokernel (in $\mathcal{Ab}$) $0$, they are the ones with cokerkels which are nilpotent. So, for example, in $\mathcal{Ab}$, the morphism $\mathbb Z\to\mathbb Z$ sending $x\to 2x$ is not an epimorphism, that same map, when considered as a map in $\mathcal{AbTF}$, is an epimorphism.
So consider the "sheafification" functor $\mathcal{PSh}\to \mathcal{Sh}$ to be much like the functor $\mathcal{Ab}\to\mathcal{AbTF}$.
(I believe, but don't quote me, that $f:A\to B$ in $\mathcal{AbTF}$ is an epimorphism if and only if $f\otimes \mathbb Q:A\otimes \mathbb Q\to B\otimes\mathbb Q$ is an epimorphism in $\mathcal{Ab}$.)
Let $\mathcal{A}$ be the category of finitely generated abelian groups. The mapping $A \mapsto TA \oplus (A/TA)$ extends to an endofunctor $F: \mathcal{A} \to \mathcal{A}$ as follows: take a morphism $f: A \to B$ of finitely generated abelian groups. Construct the morphism $Ff: TA \oplus (A/TA) \to TB \oplus (B/TB)$ as follows:
- $f$ maps torsion elements to torsion elements (if $n \cdot a = 0$, then $n \cdot f(a) = f(n \cdot a) = 0$, so $n \cdot a$ is torsion), so $f$ induces a morphism $f|_{TA}: TA \to TB$ by restriction;
- There is a morphism $g: A/TA \to B/TB$ defined by putting $g(a + TA) = f(a) + TB$. This well-defined: if $a + TA = a' + TA$, then $a - a'$ is in $TA$ and $f(a - a') = f(a) - f(a')$ is in $TB$ by the previous observation, so
$$g(a + TA) = f(a) + TB = f(a') + TB = g(a' + TA)
$$
and $g$ is well-defined. Notice that $g$ is also a morphism of groups because $f$ is;
- now we put $Ff = f|_{TA} \oplus g$. That is, an element $(a, a' + TA)$ of $TA \oplus (A/TA)$ gets mapped to $(f(a), f(a') + TB)$ in $TB \oplus (B/TB)$ by $Ff$.
Now it is quite easy to prove that $F$ is indeed a functor. What I did might look complicated, but it is indeed quite tautological: “taking torsion” is a functor $T: \mathcal{A} \to \mathcal{A}$, “modding out by torsion” is a functor $(-)/T(-): \mathcal{A} \to \mathcal{A}$ and “taking direct sums” is a functor $\oplus: \mathcal{A} \times \mathcal{A} \to \mathcal{A}$: by appropriately assembling those three functors you get $F$.
Then saying that there are natural isomorphisms $A \cong TA \oplus (A/TA)$ means that there is a natural isomorphism $\eta: F \Rightarrow \mathsf{id}_{\mathcal{A}}$ between $F$ and the identity endofunctor (think about it: this consists of a family of isomorphisms $\eta_A: TA \oplus (A/TA) \cong A$ for each object $A$ of $\mathcal{A}$).
Now there is a natural transformation $\theta: \mathsf{id}_{\mathcal{A}} \Rightarrow F$ such that for a finitely generated abelian group $A$, the morphism $\theta_A: A \to TA \oplus (A/TA)$ is the composition $A \to A/TA \to TA \oplus (A/TA)$ (prove it). If $\eta$ as above exists, you can consider the composition $\eta \circ \theta: \mathsf{id}_{\mathcal{A}} \Rightarrow F \Rightarrow \mathsf{id}_{\mathcal{A}}$, which is explicitly the composition $A \to A/TA \to TA\oplus A/TA \to A$ (where the last morphism is $\eta_A$). Since $\eta$ is supposed natural (by contradiction) and $\theta$ is natural, the composite $\eta \circ \theta$ must be a natural endomorphism of the identity functor, and this is exactly what the author means by “the hypothesized natural isomorphism would define a natural endomorphism of the identity functor”.
Best Answer
Well an epimorphism of sheaves need not be an epimorphism of presheaves.
More generally : let $C\subset D$ be a subcategory. Then an arrow $f:x\to y$ in $C$ which is an epimorphism in $D$ is automatically an epimorphism in $C$ (it's really easy to see); but the converse might not be true: there could be arrows in $D$ : $h,g: y\rightrightarrows z$ such that $h\circ f= g\circ f$ and $h\neq g$, but $g$ or $h$ or both might just not be in $C$; or $z$ might not be.
If $C$ is a full subcategory of $D$ (as in the case of sheaves), then it's simply that sometimes $z\notin C$ and there will be no such $z$ in $C$. Let's look at another example, perhaps simpler, to see what's happening:
let $D$ be the category of abelian groups, and $C$ the full subcategory of $D$ whose objects are torsion-free abelian groups. Then $2: \mathbb{Z\to Z}$ lies in $C$. Clearly, it is not an epimorphism in $D$.
However, it is an epimorphism in $C$. Indeed, if $A$ is torsion-free and $g,h : \mathbb Z\to A$ agree on $2\mathbb Z$, then they must agree (as $g(2x) = h(2x) \implies 2(h(x)-g(x)) = 0 \implies h(x) = g(x)$). So here you clearly see that $C$ sees $f$ as an epimorphism because it lacks some objects, abelian groups with torsion (specifically : $2$-torsion)
In the case of sheaves and presheaves, pretty much the same happens : suppose $F\to G$ is a morphism of sheaves such that any section in $G$ has local antecedents. Then no sheaf $H$ is going to be able to receive two different maps from $G$ that agree on $F$, because locally they must be the same, and so they must be the same globally.
In fact, that's precisely the description of epimorphisms in sheaves (although you have to prove it): a morphism of sheaves is an epimorphism (in sheaves) if and only if every section in $G$ has local antecedents (that is, for each $x\in X$ there is an open surrounding $x$ where the restriction of the section has an antecedent)