How does this follow from the definition of a stalk? Let $X$ be a topological space and $\mathcal{F}$ a presheaf on $X$. The stalk of $\mathcal{F}$ at $x$ is defined as $$\mathcal{F}_x = \varinjlim_{x\in U} \mathcal{F}(U)$$
In some books I read, that this is equivalent to $\mathcal{F}_x$ being the set of equivalence classes of pairs $(U,s)$ where $U$ is an open neighborhood of $x$ and $s\in \mathcal{F}(U)$ with the equivalence relation $(U_1,s_1) \sim (U_2,s_s)$ if and only if there exists an open neighborhood $V$ of $x$ with $V\subset U_1 \cap U_2$ such that $s_1|_V = s_2|_V$.
Why are these definitions equivalent? I know what the definition of the colimit is, but I experience it as difficult to handle. What is a good source to understand limits and colimits better?
 A: If you speak German, Martin Brandenburg has written an excellent introductory book on category theory. Otherwise, I recommend the handbook of categorical algebra by Borceux. Ultimately, even the Wikipedia page is quite useful, tho.
Let us define $\mathscr F_x$ as the set of equivalence classes you describe and check that this object satisfies the universal property. First, we have morphisms $F_U\colon\mathscr F(U)\to \mathscr F_x$ by mapping $f\in\mathscr F(U)$ to the equivalence class of $(U,f)$, which I will therefore just denote by $F_U(f)$. I will denote the restriction by $R_{VU}\colon\mathscr F(U)\to\mathscr F(V)$ for $x\in V\subseteq U$. Indeed, assume that there is some object $\mathscr G$ and morphisms $G_U\colon \mathscr F(U)\to\mathscr G$ with the property that for $x\in V\subseteq U$, we have $G_U=G_V\circ R_{VU}$. 
Then, we define a map $H\colon \mathscr F_x\to\mathscr G$ by decreeing that $H(F_U(f))=G_U(f)$. We first check that it is well-defined: If $F_{U_1}(f_1)=F_{U_2}(f_2)$  then there is a $x\in V\subseteq U_1\cap U_2$ with $R_{VU_1}(f_1)=R_{VU_2}(f_2)$. Hence, 
$$
H(F_{U_1}(f_1))=H(F_V(R_{VU_1}(f_1)))=H(F_V(R_{VU_2}(f_2)))=H(F_{U_2}(f_2))
$$
so $H$ is well-defined as a map. Depending on what kind of category your sheaf takes values in, you need to check that it also preserves structure. It is clear that we have defined $H$ in the only way possible to achieve $H\circ F_U = G_U$ for all open neighborhoods $U$ of $x$.
This verifies that $\mathscr F_x$ has the universal property of the direct limit, therefore it is one.
