Let $R_1, \ldots, R_n$ be rings and consider the cartesian product $R_1\times\ldots\times R_n$ as a ring under componentwise addition and multiplication. Show there is a canonical bijection $$\operatorname{Spec}(R_1\times\ldots\times R_n)\xrightarrow{\ \sim\ }\coprod_{i=1}^n\operatorname{Spec}R_i$$ and a similar one for spectra of maximal ideals.
Attempt:
Let $a=(a_1,\ldots,a_n)\in \operatorname{Spec}(R_1\times\cdots\times\ R_n)$, then $(R_1\times\cdots\times R_n)/a=(R_1/a_1,\ldots,R_n/a_n)$ is an integral domain. Suppose there exists nonzero $b_i,c_i\in R_i/a_i$ for all $1\leq i\leq n$ such that $b_ic_i=0$, then $b,c\in R/a$ are nonzero elements such that $bc=0$, so at least one of the factors is an integral domain.
This is what I can get. I don't know how to find the bijection. I think the L.H.S. is bigger than the R.H.S.
Edit: This is from a more elementary book of commutative algebra, so I didn't know the map in the Atiyah-Macdonald book.