# A sheaf whose stalks are zero outside a closed subset

Let $X$ be a topological space. Let $Y$ be a closed subset of $X$. Let $f\colon Y \rightarrow X$ be the canonical injection. Let $\mathcal{F}$ be a sheaf of abelian groups on $X$. Suppose $\mathcal{F}_x = 0$ for every $x \in X - Y$. Is the canonical morphism $\Gamma(X, \mathcal{F}) \rightarrow \Gamma(Y, f^{-1}(\mathcal{F}))$ an isomorphism?

Motivation Perhaps the above result can be used to prove this.

Let $U = X \setminus Y$, and let $j: U \to X$ be the inclusion. Given any sheaf $\mathcal F$ on $X$, there is a canonical short exact sequence $$0 \to j_! j^{-1}\mathcal F \to F \to f_* f^{-1}\mathcal F \to 0.$$ In your case, you are assuming that $j^{-1}\mathcal F = 0$ (since all the stalks vanish) and so you get $$\mathcal F \cong f_* f^{-1}\mathcal F.$$ Passing to global sections gives the statement you ask about.
We identify $\mathcal{F}$ with its espace etale(e.g. Hartshorne's Algebraic Geometry). By this result, $f^{-1}(\mathcal{F}) = p^{-1}(Y)$, where $p\colon \mathcal{F} → X$ is the canonical map.
Let $\psi\colon \Gamma(X, \mathcal{F}) \rightarrow \Gamma(Y, f^{-1}(\mathcal{F}))$ be the canonical morphism. Suppose $\psi(s) = 0$. Then $s_y = 0$ for every $y \in Y$. Since $F_x = 0$ for $x \in X - Y$, $s_x = 0$ for every $x \in X$. Hence $s = 0$. Hence $\psi$ is injective.
Let $t \in \Gamma(Y, f^{-1}(\mathcal{F}))$. There exists a cover $(V_i)_{i\in I}$ of $Y$ consisting of open subsets $V_i$ of $Y$ such that, for every $i \in I$, there exists an open subset $U_i$ of $X$ containing $V_i$ and $s_i \in \Gamma(U_i, \mathcal{F})$ such that $t_y = (s_i)_y$ for every $y \in V_i$. For every $i \in I$, there exists an open subset $W_i$ of $X$ such that $V_i = W_i ∩ Y$. Then $V_i \subset U_i ∩ W_i \subset U_i$. and $U_i \cap W_i \cap Y = V_i$. Hence replacing $U_i$ by $U_i \cap W_i$, and $s_i$ by $s_i|(U_i \cap W_i)$, we can assume that $V_i = U_i \cap Y$. Since $s_i|U_i \cap U_j \cap Y = t|V_i \cap V_j = s_j|U_i \cap U_j \cap Y$ and $(s_i)_x = (s_j)_x$ for every $x \in (U_i \cap U_j) - Y$, $s_i|U_i \cap U_j = s_j|U_i \cap U_j$. Hence there exists a unique $s \in \Gamma(U, \mathcal{F})$ such that $s|U_i = s_i$, where $U = \bigcup_i U_i$. Since $X - Y$ is open, there exists $s' \in \Gamma(X, \mathcal{F})$ such that $s'_x = 0$ if $x \in X - Y$ and $s'_x = s_x$ if $x \in U$. Since $s'_y = s_y = t_y$ for every $y \in Y$, $\psi(s') = t$. Hence $\psi$ is surjective.
Let $\psi\colon \mathcal{F} \rightarrow f_*(f^{-1}(\mathcal{F}))$ be the canonical morphism. It suffices to prove that $\psi$ is an isomorphism. Since $Y$ is closed, if $x \in X - Y$, $f_*(f^{-1}(\mathcal{F}))_x = 0$. If $y \in Y$, $f_*(f^{-1}(\mathcal{F}))_y = \mathcal{F}_y$. Hence it suffices to prove that if $y \in Y$, $\psi_y\colon \mathcal{F}_y \rightarrow \mathcal{F}_y$ is an isomorphism. But it is easy to see this.