Let $f:X\rightarrow Y$ be a morphism of schemes. We [know][1] that if $Y$ is affine and $f$ induces homeomorphism on the underlying spaces then $X$ is affine. Is it true that if $X$ is affine and $f$ induces a homeomorphism on the underlying spaces then $Y$ is affine? 

More generally, is it true that a scheme whose underlying space is homeomorphic (possibly via a homeomorphism that is not induced by a morphism of schemes) to the underlying space of an affine scheme is affine?   


  [1]: https://stacks.math.columbia.edu/tag/04DE