Lemma 25.11.8. Let $X$ be a scheme whose underlying topological space is a finite discrete set. Then $X$ is affine.

Proof. Say $X = \{ x_1, \ldots , x_ n\}$. Then $U_ i = \{ x_ i\}$ is an open neighbourhood of $x_ i$. By Lemma 25.11.2 it is affine. Hence $X$ is a finite disjoint union of affine schemes, and hence is affine by Lemma 25.6.8. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).