Let $R,S$ be commutative rings with identity.
Proving that $X \sqcup Y$ is an affine scheme is the same as proving that $Spec(R) \sqcup Spec(S) = Spec(R \times S)$.
I proved that if $R,S$ are rings, then the ideals of $R \times S$ are exactly of the form $P \times Q$, where $P$ is an ideal of $R$ and $Q$ is an ideal of $S$.
However, for prime ideals this is not true in general.
If $I$ is a prime ideal of $R \times S$, then $I = \mathfrak{p} \times \mathfrak{q}$, where $\mathfrak{p}$ is a prime ideal of $R$ and $\mathfrak{q}$ is a prime ideal of $S$.
But if $\mathfrak{p}$ is a prime ideal of $R$ and $\mathfrak{q}$ is a prime ideal of $S$, it is not true in general that $\mathfrak{p} \times \mathfrak{q}$ is a prime ideal of $R \times S$.
Then, $Spec(R \times S) \subseteq Spec(R) \times Spec(S)$ and the reverse inclusion is false in general.
My question is, what is $Spec(R) \sqcup Spec(S)$ set-theoretically, in order to use what I proved above?
Bearing in mind that product of two nontrivial rings can never be an integral domain, we have that any prime ideal of $R\times S$ must be of the form $\mathfrak{p}\times S$ or $R\times\mathfrak{q}$. That explains why spec of a product of two rings is the disjoint Union of the spec of the respective rlngs.