The global section of direct sum of twisted sheaves I am working with the Exercise 5.14 in Hartshorne's GTM52. And its problem (a) is stated roughly as follows.

Let $X$ be a closed subscheme of $\mathbb{P}^r_k$, a projective $r$-space over an algebraically closed field $k$, let $S$ be the homogeneous coordinate ring of $X$, i.e. $S=k[x_0,\dots,x_r]/I$, where $I=\Gamma_*(\mathscr{I}_X)$, and let $S'=\bigoplus_{n\ge0}\Gamma(X,\mathscr{O}_X(n))$.
Show that $S$ is a domain and that $S'$ is its integral closure.

Here my questions don't involve the $S$. I just want to ask something about the $S'$.
The hint of the problem (a) tells that one can regard the ring $S'$ as the global sections of such a sheaf of rings $\mathscr{S}=\bigoplus_{n\ge0}\mathscr{O}_X(n)$ on $X$, a direct sum of infinitely many sheaves. That is, there is an equation about them:
$$\Gamma(X,\mathscr{S})=\Gamma(X,\bigoplus_{n\ge0}\mathscr{O}_X(n))=\bigoplus_{n\ge0}\Gamma(X,\mathscr{O}_X(n)).$$
Does it true? I know that the arbitrary direct sum of sheaves $\{\mathscr{F}_i\}$ is defined to be the associated sheaf of the presheaf $U\mapsto\bigoplus_{i}\mathscr{F}_i(U)$. In the finite case, such a presheaf is just a sheaf. And else, it may be not, because we can give a counter-example (see here: Direct and inverse limits of sheaves). So I want to query if the global sections of $\mathscr{S}$ is just $\bigoplus_{n\ge0}\Gamma(X,\mathscr{O}_X(n))$, and if the process of sheafification doesn't change the global sections (up to an isomorphism).
Thanks in advance.
The presheaf direct sum of sheaves should be a sheaf as long as $X$ is Noetherian. Clearly it is a separated presheaf, so all we need to show is the gluability axiom. If I have an infinite collection $s_i \in \bigoplus_{j} \mathcal{F}_j(U_i)$ that agree on overlaps, then they have a natural gluing $s \in \prod_j \mathcal{F}_j(\bigcup_i U_i)$. By Noetherianness, the union of the $U_i$ is quasicompact, so in fact this section $s$ can be viewed as gluing together FINITELY many $s_i$, hence is nonzero in only finitely many entries and lives in the subgroup $\bigoplus_j \mathcal{F}_j(\bigcup_i U_i)$.
In particular, in your case above this holds and so the direct sum commutes with global sections.
If $\{F_i\}_{i\in I}$ is a set of quasi coherent sheaves on a scheme $X$ of finite type over a field, it follows the direct sum $F:=\oplus_{i \in I} F_i$ is a quasi coherent sheaf, and there is an isomorphism of global sections
$$F1.\text{   }\Gamma(X, F) \cong \oplus_{i \in I} \Gamma(X, F_i):$$
I believe taking global sections commutes with arbitrary direct sums of qc sheaves.
Question: &quot;So I want to query if the global sections of $\mathcal{S}$ is just $\oplus_{n \geq 0} \Gamma(X,\mathcal{O}_X(n))$, and if the process of sheafification doesn't change the global sections (up to an isomorphism)?&quot;
In your example $X$ is a scheme of finite type over $k$ and $F:=\oplus_{n \in \mathbb{Z}} \mathcal{O}(n)$ is a direct sum of locally trivial sheaves of rank one, in particular $\mathcal{O}(n)$ is quasi coherent. Hence it seems to me formula F1 should hold in your case. You should try to write down an explicit isomorphism
$$\Gamma(X, \oplus_{n} \mathcal{O}(n)) \cong \oplus_{n} \Gamma(X, \mathcal{O}(n)).$$