This might be a naive question. However, as a absolute noob picking up cohomology theory I am deeply confused by these two definitions of sheaf that I have encountered. I definitely lack some knowledge in category theory or algebra to fully understand sheaf cohomology.
Definition 1. Defined as a presheaf (of abelian group) satisfying sheaf axioms. In particular, I perceive a sheaf as a family of abelian groups along with a family of group homomorphisms $(\mathscr{F}, ρ)$. An element of $\mathscr{F}$ has the property of “looking like a function“ and the group homomorphism is called a section.
Definition 2. Let $X$ be a topological space, then $π \colon \mathcal{F} \to X$ is a sheaf of abelian groups if and only if:
$π$ is a local homeomorphism.
For each $x \in X$, the fiber $\mathcal{F}_x := π^{−1}(x)$ is an abelian group.
The zero section $x \to 0_x$ is continuous.
The mapping $α$ on the fiber product $\mathcal{F} \times_π \mathcal{F} = \{ (v, w) \in \mathcal{F} \times \mathcal{F} : π(v) = π(w) \}$ by $α(v, w) = v + w$ is continuous.
The mapping $β \colon \mathcal{F} \to \mathcal{F}$ defined by $β(v) = −v$ is continuous.
In this definition the sheaf becomes a topological space $\mathcal{F}$ characterized by $\pi \colon \mathcal{F} \to X$. So Definition 1 and Definition 2 seems somehow unrelated to me. In particular, a canonical example of Definition 1 is $\mathcal{C}(X)$, where as for Definition 2 a canonical example is $\mathcal{F} = X \times \mathbb{Z}$. When can we treat the sheaf as a topological space? What happened to the sections?
The first definition is what I will call a sheaf (of Abelian groups). The second definition I will call an etale space (of Abelian groups).
The two categories are equivalent. Let’s begin with an etale space. We can construct a sheaf by defining $\mathscr{F}(U) = \{f : U \to \mathcal{F} \mid f$ is continuous and $\pi \circ f = 1|_U\}$. Here, $1|_U : U \to X$ is the inclusion function. Such an $f : U \to X$ is said to be a “partial section” of $\pi$, and $\mathscr{F}$ is said to be the “sheaf of sections of $\pi$”. We then define the group operations in the obvious way. Note that this construction doesn’t require $\pi$ to be a local homeomorphism. $\DeclareMathOperator{colim}{colim}$
To go the other way, we begin with a sheaf $\mathscr{F}$. Then we define $\mathcal{F}$ as follows. The underlying set is $\coprod\limits_{x \in X} \colim\limits_{x \in U} \mathscr{F}(U)$. Recall that for a fixed $x$, $\colim_{x \in U} \mathscr{F}(U)$ is the set of stalks at $x$. So this space is the space of all stalks. The map $\pi : \mathcal{F} \to X$ is defined in the obvious way, sending a stalk at $x$ to point $x$. And the topology on $\mathcal{F}$ has basic open sets of the form $\{(x, [S]) \mid x \in V\}$, where $V \subseteq X$ is open and $S \in \mathscr{F}(V)$. The group operations are just the stalkwise group operations. Note that this construction doesn’t require $\mathscr{F}$ to be a sheaf, merely a presheaf.
These constructions are inverse equivalences of the category of sheaves and the category of etale spaces.