Qcqs lemma in Ravi Vakil's notes Qcqs lemma in Ravi Vakil's notes says that :

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.

I was trying to prove this on my own as this looks related to my previous question. This is more or less a trivial statement in case of affine schemes.  When $X=\text{Spec}(A)$, $s\in \Gamma(X,\mathcal{O}_X)=\mathcal{O}_X(X)$.
We have, $X_s=\{\mathfrak{p}\in X:s_{\mathfrak{p}}\notin \mathfrak{m}_\mathfrak{p}\subseteq \mathcal{O}_{\mathfrak{p}}\}$.  Identifying $\mathcal{O}_X(X)$ with $A$ and $\mathcal{O}_{\mathfrak{p}}$ with $A_{\mathfrak{p}}$ we have $s_{\mathfrak{p}}=\frac{s}{1}\in A_{\mathfrak{p}}$.
So, $X_s=\{\mathfrak{p}\in X:\frac{s}{1}\notin \mathfrak{p}A_{\mathfrak{p}}\}=\{\mathfrak{p}\in X:s\notin \mathfrak{p}\}=D(s)$.
So, $\Gamma(X_s,\mathcal{O}_X)=\Gamma(D(s),\mathcal{O}_X)=A_s$. We thus have isomorphism $\Gamma(X,\mathcal{O}_X)_s\rightarrow \Gamma(X_s,\mathcal{O}_X)$.
Let $X$ be an arbitrary scheme. We have $\Gamma(X,\mathcal{O}_X)\rightarrow \Gamma(X_s,\mathcal{O}_X)$, just the restriction map. 
In case of restiction map $\Gamma(X,\mathcal{O}_X)\rightarrow \Gamma(X_s,\mathcal{O}_X)$, we have $s\mapsto s|_{X_s}$. A section $t\in \mathcal{O}(U)$ is invertible iff $t_x\in \mathcal{O}_x$ is invertible for every $x\in U$. By definition, $s_x\in \mathcal{O}_x$ is invertible for every $x\in X_s$ so, $s|_{X_s}$ is invertible. So, $s^n|_{X_s}$ is invertible in $\Gamma(X_s,\mathcal{O}_X)$. Image of every element of $S=\{1,s^n:n\in \mathbb{N}\}$ is invertible in $\Gamma(X_s,\mathcal{O}_X)$.
Let $A$ be a ring, $S$ be a multiplicatively closed subset of $A$ then, we have the notation of localization of $A$  with respect to $S$ which comes with map $\pi:A\rightarrow A_S$ with $a\mapsto \frac{a}{1}$ and with universal property that given any ring $B$ and a ring homomorphism $f:A\rightarrow B$    such that $f(s)$ is a unit in $B$ for every $s\in S$ then there exists a unique map $g:A_S\rightarrow B$ such that $f=g\circ \pi$. 
So, we do have a map $\Gamma(X,\mathcal{O}_X)_s\rightarrow \Gamma(X_s,\mathcal{O}_X)$ coming from the  map $\Gamma(X,\mathcal{O}_X)\rightarrow \Gamma(X_s,\mathcal{O}_X)$. 
I am not able to proceed further. Ravi Vakil has considered some exact sequences but I think it can be done just from the map from restriction. Any hints are welcome. 
 A: You might find it helpful to have a look at Hartshorne's $\textit{Algebraic Geometry}$, Chapter II, Exercise $2.16$. In brief:
The map $\Gamma(X,\mathscr{O}_X)_s \to \Gamma(X_s,\mathscr{O}_X)$ being injective means that given a section $a\in \Gamma(X,\mathscr{O}_X)$ whose restriction to $X_s$ is zero, there exists some $n$ such that $s^n \cdot a=0$.
For proving surjectivity, note that the intersection of two open affines in $X$ is quasi-compact since $X$ is quasi-separated. Use this to prove that multiplying a section of $\mathscr{O}_X$ over $X_s$ by a suitable power of $s$ you obtain an element which is the restriction of a global section.
If you need some further details, let me know.
$\textbf{Edit}$ For proving the part about surjectivity, let $X=\bigcup_{i=1}^n \operatorname{Spec}(A_i)$ be a finite open affine covering of $X$ and let $a\in \Gamma(X_s,\mathscr{O}_X)$. Since the statement we want to prove is true for affine schemes (the restriction map to $X_s$ is simply the localization map in this case), there exists some $m$ (independent of $i=1,\ldots,n$) and elements $a_i\in A_i$ such that $s^m \vert_{X_s \cap \operatorname{Spec}(A_i)} \cdot a\vert_{X_s \cap \operatorname{Spec}(A_i)} = a_i\vert_{X_s\cap \operatorname{Spec}(A_i)}$. In particular, $a_i\vert_{\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)} - a_j\vert_{\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)}\in \Gamma(\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j),\mathscr{O}_X)$ restricts to $0$ over $X_s\cap \operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)$. Since the intersection of two open affines of $X$ is quasi-compact, we conclude from the injectivity part that there exists some $M$ (independent of $i,j$) such that
$$
s\vert_{\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)}^M \cdot a_i\vert_{\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)} = s\vert_{\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)}^M \cdot a_j\vert_{\operatorname{Spec}(A_i)\cap \operatorname{Spec}(A_j)}
$$
for all $i,j=1,\ldots,n$. In other words, the sections $s\vert_{\operatorname{Spec}(A_i)} \cdot a_i$ glue to a section $b$ and since
$$
b\vert_{X_s\cap \operatorname{Spec}(A_i)} = (s^M\vert_{\operatorname{Spec}(A_i)} \cdot a_i)\vert_{X_s\cap \operatorname{Spec}(A_i)}= s^{M+m}\vert_{X_s\cap \operatorname{Spec}(A_i)} \cdot a\vert_{X_s\cap \operatorname{Spec}(A_i)}
$$
for $i=1,\ldots,n$, we conclude that $b\vert_{X_s}=s^{M+m}\vert_{X_s} \cdot a$.
A: Consider restriction map $\Gamma(X,\mathcal{O}_X)\rightarrow \Gamma(X_s,\mathcal{O}_X)$. Suppose $a\in \Gamma(X,\mathcal{O}_X)$ be such that $a|_{X_s}=0$. 
As $X_s=\{x\in X: s_x\notin \mathfrak{m}_x\subseteq \mathcal{O}_x\}$, $a|_{X_s}=0$ implies that $a_x=0\in A_x$ for every $x\in X_s$. By the observation as in the case of affine scheme this $a_x$ is identified with $\frac{a}{1}\in A_x$ which only means that $ta=0$ for some $t\notin x$. As $x\in X_s$ it means that, $s\notin x$. This does not say that $sa=0$ or $s^na=0$ for some $n\in \mathbb{N}$. This approach does not give any information even in the case of affine schemes. Localizing at each element (prime ideal) in $X_s$ separately does not give enough information. We have to localize at an element of rings. Plan is to localize at restrictions of $s$ in elements in finite affine open cover of $X$.
As $X$ is quasi compact we have $X=\bigcup _{i=1}^r\text{Spec}(A_i)$ and that $X_s=\bigcup _{i=1}^r(X_s\cap \text{Spec}(A_i))$. Let $s_i=s|_{\text{Spec}(A_i)}$. Then $X_s\cap \text{Spec}(A_i)=D(s_i)$. As $a|_{X_s}=0$, this mean 
$a|_{X_s\cap \text{Spec}(A_i)}=0$ for each $1\leq i\leq r$. This means that $a_i|_{D(s_i)}=0$ where $a_i=a|_{\text{Spec}(A_i))}$. By observation as in question, $a_i|_{D(s_i)}=0$  means that $s_i^{n_i}a_i=0$ for some $n_i\in \mathbb{N}$. Let $n=\max\{n_i:1\leq i\leq r\}$. So, $s_i^na_i=0$ for every $q\leq i\leq r$ i.e., $(s^na)|_{\text{Spec}(A_i)}=0$ for every $1\leq i\leq r$. So, by identity axion, this means that $s^na=0$. 
