If is an affine scheme, each reduced irreducible component is a closed subscheme, hence an affine scheme. We prove the converse by explicit affine gluing along closed subschemes.
First suppose is the scheme-theoretic union of two closed subschemes which are affine schemes and : their defining ideal sheaves have zero intersection. Their scheme-theoretic intersection is a closed subscheme of both, hence an affine scheme. Write
The two maps and are surjective. Form the fiber product of rings
Both projections are surjective. Let and . Then
For the last equality, the common image map is surjective, and its kernel of a ring homomorphism consists exactly of pairs whose two coordinates map to zero. Therefore has closed pieces isomorphic to and , with intersection . They cover it because each prime ideal contains or , as .
A finite closed cover determines the topology: a subset is closed if and only if its intersections with both closed pieces are closed. The identifications of therefore give a homeomorphism between and . To check the structure sheaf, on the elementary ideal-intersection sequence gives
It is exact on stalks, by . The same sequence holds on , using . Under the homeomorphism, the two middle sheaves and their restriction maps identify, so their kernels identify as sheaves of rings. This identifies the structure sheaves, giving an isomorphism of schemes . The intersection need not be reduced.
Now a Noetherian scheme has finitely many irreducible components . Induct on . For , the reduced scheme is its single reduced irreducible component, so is an affine scheme. For , let and let be the reduced union of the remaining irreducible components. Its components are the corresponding , so is an affine scheme by induction. The defining ideal sheaves of and have zero intersection: their intersection is the ideal sheaf of the reduced union of all components, which is zero because is reduced. The two-piece argument proves that is an affine scheme. The empty scheme is and causes no exception. Hence