For 2 topological spaces $(X,T_X)$ and $(Y,T_Y)$, I write $X \simeq Y$ if $X$ and $Y$ are homeomorphic. If $A \subset X$, I always endow $A$ with the subspace topology.
I was led to consider the following assumptions.
(1) $(X,T_X)$ is a topological space such that for all $A$,$B$ $\subset X$ : $A$ closed and $A \simeq B$ $\Rightarrow$ $B$ closed
It is true if $X$ is discrete or compact Hausdorff, but it's not true if $X = \mathbb{R}^n$, $n \geq 1$ (because $\mathbb{R}^n \simeq (0,1)^n$), or if $X$ has a closed singleton and an other non-closed singleton (like $X=\{a,b\}$ with $T_X = \{ \varnothing, \{a\}, \{a,b\}$).
(2) $(X,T_X)$ is a topological space such that for all $A$,$B$ $\subset X$ : $A$ open and $A \simeq B$ $\Rightarrow$ $B$ open
Again, it is true if $X$ is discrete, or if $X = \mathbb{R}^n$ with $n \geq 0$ (invariance of domain), but it's not true if $X$ has an open singleton and an other non-open singleton (like $X=\{a,b\}$ with $T_X = \{ \varnothing, \{a\}, \{a,b\}$).
My question is :
What are the conditions on the space $X$ that guarantee that one of $(1)$ and $(2)$ is true, or at least some examples apart from the ones mentionned ?
A topic already exists (Homeomorphic closed subspaces.) that deals whith $(1)$ but they don't give the general answer there. However, they say in this topic that if $X$ is countably compact and first countable, $(1)$ holds : why ?