Section of a presheaf can be viewed as functions I am reading the section on 'Presheaves and sheaves', i.e., Section 6.3 from Bosch's Algebraic Geometry and Commutative Algebra, and I couldn't understand the following :
After defining presheaf of sets (or any other category), the author says: "Sometimes it is convenient to imagine the elements of $\mathcal{F}(U)$ as functions on $U$ ....." (here  $\mathcal{F}$ is a presheaf and $U$ is an open subseet of topological space $X$). 
I can't seem to get my head around seeing how exactly this identification is being made. Please help me with this.
 A: There actually is a precise way to view sections in $\mathcal{F}(U)$ of an arbitrary presheaf $\mathcal{F}$ on a space $X$ as functions on $U$.
At every point $x\in X$, the presheaf $\mathcal{F}$ has a stalk $\mathcal{F}_x$, which is defined to be the directed colimit $\varinjlim_{x\in V}\mathcal{F}(V)$, where the colimit is taken over all open neighborhoods $V$ of $x$ along the restriction maps $\mathcal{F}(V)\to \mathcal{F}(V')$ when $V'\subseteq V$. Concretely, $\mathcal{F}_x = \left( \bigcup_{x\in V}\mathcal{F}(V)/{\sim}\right)$, where $\sim$ is the equivlence relation given by $f\sim g$ if $f\in \mathcal{F}(V)$, $g\in \mathcal{F}(V')$, and there is some $x\in V''\subseteq V\cap V'$ such that $f$ and $g$ agree upon restriction to $V''$. We write $f_x$ for the equivalence class of $f$ in the stalk $\mathcal{F}_x$ and call it   the germ of $f$ at the point $x$.
Now fixing an open set $U$, at every point $x\in U$, there is a map $\mathcal{F}(U)\to \mathcal{F}_x$ sending $f\in \mathcal{F}(U)$  to $f_x\in \mathcal{F}_x$. Turning things around, we can think of a section $f\in \mathcal{F}(U)$ as a function $x\mapsto f_x$.  This function has domain $U$ and codomain $\bigcup_{x\in U}\mathcal{F}_x$, where for all $x\in U$, $f(x) = f_x\in \mathcal{F}_x$.
Ok, this is a weird kind of function - in particular the codomain is hard to understand. But it is a useful perspective for a number of reasons. Here are two:
(1) This is one path to the definition of sheaf and the notion of sheafification.
For one thing, we may notice that sometimes two distinct sections $f\neq f'$ in $\mathcal{F}(U)$ give rise to the same function on $U$. It turns out that this happens if and only if there an open cover $U = \bigcup_{i\in I} U_i$ such that $f$ and $f'$ restrict to the same section in $\mathcal{F}(U_i)$ for all $i$. A presheaf in which the association of functions to sections is one-to-one is called a separated presheaf - this is the first sheaf axiom.
Second, we may wonder about the other functions $U\to \bigcup_{x\in U}\mathcal{F}_x$ which don't come from sections in $\mathcal{F}(U)$. Of course, there are a lot of these. But there's a natural topology we can put on $\bigcup_{x\in U}\mathcal{F}_x$ such that each $f\in \mathcal{F}(U)$ induces a continuous function, which is a section of the natural projection map $\bigcup_{x\in X}\mathcal{F}_x\to X$, mapping $f_x\mapsto x$.
The resulting topological space is called the étalé space of $\mathcal{F}$ over $U$. It turns out that every continuous section from from $U$ to the étalé space is formed by gluing sections of $\mathcal{F}$ from an open cover over $U$. If we let $\widehat{\mathcal{F}}(U)$ be the set of all continuous sections on $U$, then $\widehat{F}$ is a sheaf on $X$, which is called the sheafification of $\mathcal{F}$. If $\mathcal{F}$ was already a sheaf, then $\mathcal{F} = \widehat{\mathcal{F}}$. In this way, we can think of the sections of any sheaf on $X$ as literally being the sheaf of continuous sections to the étalé space of $X$.
(2) In many contexts, the stalks are less weird than they seem. For example, in the structure sheaf $\mathcal{O}_X$ of an affine scheme $X = \text{Spec}(A)$, the stalk $\mathcal{O}_{X,p}$ is isomorphic to the localization $A_p$ of $A$ at the prime ideal $p$. The ring $A_p$ is local with maximal ideal $pA_p$, so $A_p/pA_p$ is a field. After composing with the quotient map, we can view sections as functions on $X$ which actually map points in $X$ to elements of a field (though the field may be different for different points!).
For example, if $X$ is the affine line over an algebraically closed field $k$, then a closed point $p$ is a maximal ideal generated by $(x-a)$ for some $a\in k$. The stalk $\mathcal{O}_{X,p}$ is the local ring $k[x]_p$, and the quotient field $k[x]_p/pk[x]_p$ is isomorphic to $k$. The function induced by a section $f$ really maps $p = (x-a)$ to the evaluation of $f$ at $a$.
Not every point is closed, though. There is also the generic point $p = (0)$. Here the stalk $\mathcal{O}_{X,p}$ is the field of fractions $k(x)$ which is already a field. And the function induced by a section $f$ maps $p$ to $f$ itself, viewed as a rational function in $k(x)$. You should think of this as the generic evaluation of $f$ at the variable $x$.
