When is a scheme over an affine scheme affine?
Question: Let $X$ be a scheme. Let ${\rm{Spec}}(R)$ be an affine scheme for some ring $R$. Suppose that there is a morphism of schemes $f:X\rightarrow{\rm{Spec}}(R)$. What properties should $f$ have so that $X$ is also an affine scheme? Or what conditions can make $X$ affine?
Answer: If $f$ is an affine morphism, then $X$ is affine by definition.
This is an "if and only if". If $X$ is affine, the so is $f$. See theorem 7.3.7 in Vakil's Foundations of Algebraic Geometry, or 29.11.3 and 29.11.4 in the Stacks Project.
So in particular if $f$ is a closed immersion, then $f$ is affine such that $X$ is affine, for example.
There is no comment, let's add the first one.