Let $A$ be a ring, $X$ a noetherian separated $A$ scheme, $Y$ an $A$ scheme, $f: X \to Y$ an $A$ morphism, and $B$ a faithfully flat $A$ algebra. Then, if $ f_B : X_B \to Y_B $ is a closed immersion, then so is $f$?
I've proven it as follow: First, since the property "closed immersion" is local, we may assume $Y = \operatorname{Spec}C$. Next, for every quasi-coherent sheaf $\mathscr{F}$ on $X$ and every integer $i$, by the flat base change theorem, $H^i(X, \mathscr{F}) \otimes_A B = H^i(X_B, \pi^*\mathscr{F})$. ($\pi : X_B \to X$ is the base change morphism.) Now, since $f_B$ is a closed immersion, $X_B$ is affine. So by Serre's affineness criterion and equation above (and the faithfully flatness of $B$), we obtain that $X$ is affine( say $= \operatorname{Spec}D$). Now $f_B : X_B \to Y_B $ corresponds to $ (C \to D ) \otimes_A B$, and this is surjective. So by the faithfully flatness of $B$, $C \to D$ is surjective, and so $f$ is a closed immersion.
Is this correct? And is there more simple or general proof?