Localization of sheaves Let $(X,\mathscr{O}_X)$ a ringed space and $\mathscr{F}$ an $\mathscr{O}_X$-module. Let $U\subseteq X$ be an open subset, and suppose we have $\mathscr{F}|_U=\mathscr{O}_U$, then for $x\in U$, how does this imply $\mathscr{F}_x=\mathscr{O}_{X,x}$? The explanation I saw was "because localization preserves exactness", but I don't quite understand how does it work here. Can somebody explain?
 A: Turning my comment into an answer:
This is essentially the same as the other two excellent answers, but is more elementary (if, for example, you don't want to think about the inverse image sheaf, cofinal systems, etc.). For any sheaf $\mathscr{G}$ on a topological space $X$ and any open set $U \subseteq X$ with $x \in U$, the stalk of the restricted sheaf $(\mathscr{G}|_U)_x$ is equal to the stalk of the original sheaf $\mathscr{G}_x$. In your case, you can simply apply this twice:
$$
\mathscr{F}_x = (\mathscr{F}|_U)_x = \mathscr{O}_{U , x} = \mathscr{O}_{X , x}
$$
A: I don't know how an argument that explicitely exploits the fact that
'localization preserves exactness'
works, but instead I would like to use the property of injective limits
with resprect to cofinal index systems. It says that if
$\varinjlim_{i \in I} A_i$ and $J \subset I$ is a cofinal system then
$\varinjlim_{i \in I} A_i= \varinjlim_{j \in J} A_i$.
recall that by definition $F_x= \varinjlim_{x \in V} F(V)$ where we consider
the injective system consisting of open $V \subset X$ containing
$x$. Then the subsystem of $V' $ with $V' \subset U$ is a cofinal system and
therefore
$$F_x= \varinjlim_{x \in V} F(V)= \varinjlim_{x \in V \subset U} F(V)  
\varinjlim_{x \in V \subset U} O(V)=   \varinjlim_{x \in V } O(V)=
O_{X,x} $$
But don't accept it as 'answer' so far, instead as an 'alternative' argument,
since I'm also curious how the proof of your problem using
that 'localization preserves exactness' in detail work, I don't know it.
A: It depends on how much formality you have seen but for me the most satisfying proof is:
let $j: U \rightarrow X$ be the inclusion and $i: \{\star \} \rightarrow U$ of image $x$. We have pullback functors $$j^{-1}: Sh(X) \rightarrow Sh(U) \\ i^{-1}: Sh(U) \rightarrow Sh(\{\star\}) \\
(j \circ i)^{-1}: Sh(X) \rightarrow Sh(\{\star\}).$$
And they are compatible with composition: $i^{-1} \circ j^{-1} = (j \circ i)^{-1}$.
By definition $\mathcal{F} \vert_U = j^{-1} \mathcal{F}$ and $O_U = j^{-1}O_X$.
Hence $\mathcal{F}_x = (j \circ i)^{-1} \mathcal{F} = i^{-1} \circ j^{-1} \mathcal{F} = i^{-1} \circ j^{-1} O_X = (j \circ i)^{-1} O_X = O_{X,x}$
