This is a lemma from Hartshorne's Algebraic Geometry.
Let $X=\text{Spec}(A)$ be an affine scheme $f\in A, D(f)\subseteq X$. Let $\mathcal{F}$ be a quasi coherent sheaf on $X$.
If $s\in \Gamma(X,\mathcal{F})$ is such that $s|_{D(f)}=0$ then for some $n>0$, $f^ns=0$.
If $t\in \Gamma(D(f),\mathcal{F})$ then for some $n>0$ $f^nt$ extends to a global section of $\mathcal{F}$ over $X$.
I tried to see what this means in case of simple quasicoherent sheaves.
- For $X=\text{Spec}(A)$, structure sheaf $\mathcal{O}_X$ is a quasicoherent sheaf of $\mathcal{O}_X$ modules. In this case, $\mathcal{F}(X)\rightarrow \mathcal{F}(D(f))$ is $\mathcal{O}_X(X)\rightarrow \mathcal{O}_X(D(f))$ i.e., $A\rightarrow A_f$. So, $s|_{D(f)}=0$ means that $\frac{s}{1}=0\in A_f$ i.e., $f^ns=0$ for some $n\in \mathbb{N}$.
- For $X=\text{Spec}(A)$ and for an $A$ module $M$, $\widetilde{M}$ is a quasicoherent sheaf of $\mathcal{O}_X$ modules. In this case, $\mathcal{F}(X)\rightarrow \mathcal{F}(D(f))$ is $\widetilde{M}(X)\rightarrow \widetilde{M}(D(f))$ i.e., $M\rightarrow M_f$. So, $s|_{D(f)}=0$ means that $\frac{s}{1}=0\in M_f$ i.e., $f^ns=0$ for some $n\in \mathbb{N}$.
- For $X=\text{Spec}(A)$, structure sheaf $\mathcal{O}_X$ is a quasicoherent sheaf of $\mathcal{O}_X$ modules. In this case, $\mathcal{F}(X)\rightarrow \mathcal{F}(D(f))$ is $\mathcal{O}_X(X)\rightarrow \mathcal{O}_X(D(f))$ i.e., $A\rightarrow A_f$. Let $t\in \Gamma(D(f),\mathcal{F})=A_f$ so, $t=a/f^n$ for some $n\in \mathbb{N}$ i.e., $f^nt=a\in A_f$. So, $a\in \Gamma(X,\mathcal{F})$ is such that its restiction to $\Gamma(D(f),\mathcal{F})$ is $a/1=f^nt$.
- For $X=\text{Spec}(A)$ and for an $A$ module $M$, $\widetilde{M}$ is a quasicoherent sheaf of $\mathcal{O}_X$ modules. In this case, $\mathcal{F}(X)\rightarrow \mathcal{F}(D(f))$ is $\widetilde{M}(X)\rightarrow \widetilde{M}(D(f))$ i.e., $M\rightarrow M_f$. Let $t\in \Gamma(D(f),\mathcal{F})=M_f$ so, $t=a/f^n$ for some $n\in \mathbb{N}$ i.e., $f^nt=a\in M_f$. So, $a\in \Gamma(X,\mathcal{F})$ is such that its restiction to $\Gamma(D(f),\mathcal{F})$ is $a/1=f^nt$.
Now comes the general case $\mathcal{F}$ a quasi coherent sheaf of $\mathcal{O}_X$ modules. We can find an open cover for $X=\text{Spec}(A)$ of the form $\{D(g_i)\}_{i=1}^r$ and $A_{g_i}$ modules $M_i$ such that $\mathcal{F}|_{D(g_i)}=\widetilde{M_i}$.
To prove that $f^ns=0$, the strategy is to prove that $f^ns|_{D(g_i)}=0$ for all $1\leq i\leq r$. Then by gluing we see that $f^ns=0$.
Let $s_i=s|_{D(g_i)}$. We have $\mathcal{F}(D(g_i))\rightarrow \mathcal{F}(D(f)\cap D(g_i))=\mathcal{F}(D(fg_i))$. As $\mathcal{F}|_{D(g_i)}=\widetilde{M_i}$ we have $\widetilde{M_i}(D(g_i))\rightarrow \widetilde{M_i}(D(fg_i))$ i.e., $M_i\rightarrow (M_i)_{fg_i}$ and $s_i\mapsto \frac{s_i}{1}=0\in (M_i)_{fg_i}$ i.e., $g_i^{n_i}f^{n_i}s_i=0$. Let $n=\max\{n_i:1\leq i\leq r\}$. We then have $g_i^nf^ns_i=0$.
I am stuck here. Any hints are welcome.
In other words what we want to prove is the following :
Given $f\in A$, the restirction map $\Gamma(X,\mathcal{F})\rightarrow \Gamma(D(f),\mathcal{F})$ is
close to being injective upto localization. We have $s\in \Gamma(X,\mathcal{F})$ such that $s|_{D(f)}=0$ then $f^ns=0$ for some $n$. If we consider image of $f^ns$ in $\Gamma(X,\mathcal{F})_f$ it is just $s$. So, $\Gamma(X,\mathcal{F})_f\rightarrow \Gamma(D(f),\mathcal{F})$ is injective.
close to being surjective upto localization. We have $t\in \Gamma(D(f),\mathcal{F})$ then there exists an element $s\in \Gamma(X,\mathcal{F})$ whose restriction is $f^nt$ for some $n$. It is not as straightforward as the injective case but i am sure this means $\Gamma(X,\mathcal{F})_f\rightarrow \Gamma(D(f),\mathcal{F})$ is surjective.
So, we are trying to prove that $\Gamma(X,\mathcal{F})_f\cong\Gamma(D(f),\mathcal{F})$. This is just my interpretation and it could mean something different than that of the original question.
Is my interpretation close to the question given? This seems to be reasonable to expect. We have similar result called qcqs lemma which says
If $X$ is a quasi compact quasi separated scheme and $s\in \Gamma(X,\mathcal{O}_X)$ then the natural map $\Gamma(X,\mathcal{O}_X)_s\rightarrow \Gamma(X_s,\mathcal{O}_X)$ is an isomorphism.