Edit: This seems to be wrong, as pointed out by Will Sawin in the comments.
The prime ideals of $\mathbb{Z}$ and $\mathbb{Z}[x]$ are well-known. It is also not too hard to compute the underlying set of $\operatorname{Spec}(\mathbb{Z}[x_1, \dots, x_n])$ for arbitrary $n$; the description is as follows:
Proposition Each prime ideal of $\operatorname{Spec}(\mathbb{Z}[x_1, \dots, x_n])$ has the form $(f_0, f_1, \dots, f_n)$ where
- $f_0$ is $0$ or a prime number,
- $f_1 \in \mathbb{Z}[x_1]$ is $0$ or a polynomial which is irreducible over the residue field of $(f_0) \trianglelefteq \mathbb{Z}$,
- $f_2 \in \mathbb{Z}[x_1][x_2]$ is $0$ or a polynomial which is irreducible over the residue field of $(f_0, f_1) \trianglelefteq \mathbb{Z}[x_1]$,
- $f_3 \in \mathbb{Z}[x_1, x_2][x_3]$ is $0$ or a polynomial which is irreducible over the residue field of $(f_0, f_1, f_2) \trianglelefteq \mathbb{Z}[x_1,x_2]$,
- etc.
Proof. We induct on $n$. The base case $n = 0$ is easy. Now suppose this classification is correct for some $n \geq 0$. There is an inclusion $i : \mathbb{Z}[x_1, \dots, x_n] \to \mathbb{Z}[x_1, \dots, x_{n+1}]$, which gives a morphism $$i^{-1} : \operatorname{Spec}(\mathbb{Z}[x_1, \dots, x_{n+1}]) \to \operatorname{Spec}(\mathbb{Z}[x_1, \dots, x_n]).$$ Take an arbitrary element $\mathfrak{p}$ of $\operatorname{Spec}(\mathbb{Z}[x_1, \dots, x_n])$, which by inductive hypothesis can be written as $\mathfrak{p} = (f_0, \dots, f_n)$ with $f_0, \dots, f_n$ as described above. The fiber of $i^{-1}$ over $\mathfrak{p}$ is homeomorphic to $$\operatorname{Spec}(k(\mathfrak{p}) \otimes_{\mathbb{Z}[x_1, \dots, x_n]} \mathbb{Z}[x_1, \dots, x_{n+1}]) \cong \operatorname{Spec}(k(\mathfrak{p})[x_{n+1}])$$ where $k(\mathfrak{p})$ denotes the residue field of $\mathfrak{p} \trianglelefteq \mathbb{Z}[x_1, \dots, x_n]$. Since $k(\mathfrak{p})$ is a field, an element of $\operatorname{Spec}(k(\mathfrak{p})[x_{n+1}])$ has the form $(\bar{f}_{n+1})$ where $\bar{f}_{n+1}$ is $0$ or an irreducible polynomial in $k(\mathfrak{p})[x_{n+1}]$.
Thus, an arbitrary element of the fiber of $i^{-1}$ over $\mathfrak{p}$ has the form $(f_0, \dots, f_n, f_{n+1})$, where $f_{n+1}$ is $0$ or a polynomial in $\mathbb{Z}[x_1, \dots, x_n][x_{n+1}]$ which is irreducible over $k(\mathfrak{p})$. $\square$
I am seeking a reference for this result. Does it appear in some classic tome on commutative algebra, for example?