The functor induces an arrow-reversing equivalence of categories between the category of affine varieties over and the category of finitely generated integral domains over .

My textbook (Hartshorne) says that this is a corollary to the following proposition:

Let be any variety and let be an affine variety. Then there is a natural bijective mapping of sets

where the left means morphisms of varieties, and the right means homomorphisms of -algebras.

I do not see how to apply the proposition to prove this corollary. I would appreciate advice on this. Thanks.