If $X$ is an affine scheme with coherent sheaf $\mathcal{F}$, $Y$ any scheme with
$$0 \rightarrow \mathcal{F} \rightarrow \mathcal{O}_Y \rightarrow \mathcal{O}_X \rightarrow 0$$
exact such that $\mathcal{F}^2=0 \subset \mathcal{O}_Y$. Is $Y$ necessarily affine too?
In more details, if $\mathcal{F} \subset \mathcal{O}_Y$ is a sheaf of ideals that squares to zero, such that the schemes $X$ with structure sheaf $\mathcal{O}_X$ is isomorphic to the scheme $Y'=(Y,\mathcal{O}_Y/\mathcal{F})$, is then $Y$ with its own structure sheaf affine?
The answer is yes:
If $Y'=(Y,\mathcal O_Y/\mathcal F)$ is affine for some nilpotent $\mathcal F$, then $Y_{red}=(Y,\mathcal O_Y/\operatorname{nil}(\mathcal O_Y))$ is also affine, because this is a closed subscheme of the affine scheme $Y'$.
It is well known that a scheme is affine if and only if its reduced scheme structure is affine. In the noetherian case, this is very easy, but it is also true in the general case, see here.
Thus we conclude that $Y$ is affine.