If $Y$ is a projective variety with homogeneous coordinate ring $S(Y)$, show that $\dim S(Y)=\dim Y+1$. [Hint: Let $\varphi_i:U_i\to\mathbb A^n$ be the homeomorphism of (2.2), let $Y_i$ be the affine variety $\varphi_i(Y\cap U_i)$, and let $A(Y_i)$ be its affine coordinate ring. Show that $A(Y_i)$ can be identified with the subring of elements of degree $0$ of the localized ring $S(Y)_{x_i}$. Then show that $S(Y)_{x_i}\cong A(Y_i)[x_i,x_i^{-1}]$. Now use (1.7), (1.8A), and (Ex 1.10), and look at transcendence degrees. Conclude also that $\dim Y=\dim Y_i$ whenever $Y_i$ is nonempty.]
$\newcommand{\trdeg}{\operatorname{tr.deg.}}$Our format for this exercise will be to list out the calculations that Hartshorne leaves for the reader in the hint sketch, completing them as we go along.
1. $\varphi_i(Y\cap U_i)$ is an affine variety. This is a direct consequence of Corollary 2.3.
2. $A(Y_i)\cong(S(Y)_{x_i})_0$. First, note that we can reduce to the case where $x_i\notin I(Y)$. This is because if $x_i\in I(Y)$, then $x_i=0$ in $S(Y)$, thus the localization $S(Y)_{x_i}$ is trivial. Similarly, we see $Y\cap U_i=\emptyset$, so $A(Y_i)$ is also trivial and the identification is just $0\mapsto 0$.
Now we assume $x_i\notin I(Y)$. Then elements of $S(Y)_{x_i}$ have the form $\frac f{x_i^e}$, where $f$ is homogeneous and $e$ is a positive integer. This has degree zero if $\deg f=e$, and we see that all elements of $(S(Y)_{x_i})_0$ have the form $$f\left(\frac{x_0}{x_i},\dots,\frac{x_{i-1}}{x_i},1,\frac{x_{i+1}}{x_i},\dots,\frac{x_n}{x_i}\right).$$ We can define $\alpha: (S(Y)_{x_i})_0\to A(Y_i)$ to be the dehomogenization map that takes such an $f$ to its image. Now, consider $\alpha^{-1}:A(Y_i)\to(S(Y)_{x_i})_0$ taking $f\mapsto x_i^{-\deg f}f$. By the proof of Proposition 2.2 these are inverses.
3. $S(Y)_{x_i}\cong A(Y_i)[x_i,x_i^{-1}]$. This follows from the general obvious fact that $R_x\cong (R_x)_0[x_i,x_i^{-1}]$ if $R$ is a ring with $x\in R$. This isomorphism follows in turn from the definition of localization - we can divide or multiply by any power of $x_i$ in $S(Y)_{x_i}$.
4. The desired claim. First, note $$K((S(Y)_{x_i})_0)(x_i)\cong K(S(Y)_{x_i})\cong K(S(Y)).$$ Then $$\begin{align*}\dim S(Y)&=\trdeg K(S(Y))\\&=\trdeg K((S(Y)_{x_i})_0)(x_i)\\&=1+\trdeg K((S(Y)_{x_i})_0)\\&=1+\dim Y\cap U_i.\end{align*}$$ Since $Y\cap U_i$ open cover $Y$, we have $\dim Y\cap U_i=\dim Y$ for some $i$. But $\dim Y\cap U_i=\dim S(Y)-1$ for any $i$, so it is constant, thus $\dim Y\cap U_i=\dim Y$ for all $i$. Finally, $\dim Y = \dim Y\cap U_i=\dim S(Y)-1$ as desired.
5. $\dim Y=\dim Y_i$ if $Y_i\neq\emptyset$. This is immediate, since $\varphi_i$ preserves dimension.