In his "Algebraic Geometry", Hartshorne proves that for any ringed spaces $(X,\mathcal O\_X)$, category $Mod(X)$ of sheaves of $\mathcal O\_X$-modules has enough injectives. If we take $\mathcal O\_X$ to be constant *sheaf* of rings $\underline{\mathbb Z}\_X^{\natural}$ (i.e. sheaf associated to a constant presheaf $\underline{\mathbb Z}\_X$), Hartshorne claims that $Mod(X)=Ab(X):=$ category of sheaves of abelian groups on X.


Why does this last claim hold? Of course, if one takes open subset $U \subseteq X$ that is connected, then section $\mathcal O\_X(U)$ actually is ring isomorphic to $\mathbb Z$. But, for more 'complicated' open subsets $U \subseteq X$, sections $\mathcal O\_X(U)$ become more complicated rings than $\mathbb Z$. So generally, many sections of a sheaf of $\mathcal O\_X$-modules have more complicated structure than merely abelian group (i.e. $\mathbb Z$-module).


So, why is it obvious, according to Hartshorne, that $Mod(X)=Ab(X)$? I can only see that $Mod(X)$ is subcategory of $Ab(X)$.



Sheaves of $\mathbb Z$-modules = sheaves of abelian groups
$\def\sh#1{\mathcal{#1}}\def\csheaf#1{\underline{#1}}\def\on#1{\operatorname{#1}}$First of all, if $X$ is an irreducible scheme (or any such topological space), then all of its open subsets are connected and there are no complications such as you describe. However, the complications dry up under close examination no matter what, because we are talking about *sheaves* of abelian groups versus *sheaves* of $\sh{O}$-modules, and thus the same gluing property that alters the sections of the constant sheaf on $\mathbb{Z}$ alters the sections of its modules in such a way that nothing goes wrong. Here are the details:


Given a sheaf of abelian groups $\sh{F}$ and a sheaf of rings $\sh{O}$, the structure of an $\sh{O}$-module on $\sh{F}$ is the same as a homomorphism of sheaves of rings $\sh{O} \to \sh{Hom}(\sh{F}, \sh{F})$, where the last object is the sheaf of group homomorphisms from $\sh{F}$ to itself. If $\sh{O}$ is the constant sheaf on a ring $R$, then it is the sheafification of the constant *presheaf* $\csheaf{R}$ on $R$, and by the universal property of sheafification, it suffices to give a map $\csheaf{R} \to \sh{Hom}(\sh{F}, \sh{F})$ (this extends uniquely to $\sh{O}$). But the sections of $\csheaf{R}$ are just $R$ for any open set, even disconnected ones, and so that's the same as a map $R \to \on{Hom}(\sh{F}|\_U, \sh{F}|\_U)$ for any open $U$, compatible with restrictions. This gives in particular a collection of maps $R \to \on{Hom}(\sh{F}(U), \sh{F}(U))$ compatible with restrictions, and these two data are equivalent since a map of sheaves *is* just a collection of maps of sections compatible with restrictions. Of course, the last kind of data is the same thing as an $R$-module structure on $\sh{F}$, as you want.


