A $T_4$ space satisfying that 'every continuous map from it to a Hausdorff space is a closed map' is compact. Suppose a $T_4$ space $X$ satisfies a property that every continuous map $f$ from $X$ to any Hausdorff space $Y$ is a closed map. Show that $X$ is compact.
What I am thinking is to let $\mathcal{U}$ be an open cover of $X$ and find a way to choose finite open sets from $\mathcal{U}$ that can cover $X$ again. Do we need to define a suitable continuous map by ourselves and use the fact that it is a closed map to choose suitable open sets from $\mathcal{U}$? I have tried to define a continuous map $f \colon X \to Y$ as mapping different open sets from $\mathcal{U}$ to different points in $Y$. However, different open sets from $\mathcal{U}$ may intersect with each other and hence $f$ may not be well-defined. Apart form that, I have no idea about how to choose suitable $f$ and $Y$. Can someone help me please?
Edit 1: I am trying to apply the Urysohn Lemma or the Tietz Extension Theorem due to the normality of $X$. But still have no idea.
Edit 2: Finally found a way to prove without using compactification. I will post the proof when I’m free. Hint: Use Urysohn Lemma and Tychonoff Theorem.
 A: Any such $X$ has a compactification $(\gamma X, e)$ in which $e: X \to \gamma X$ is an embedding with a dense image (this uses $T_{3\frac12}$). Then the assumption says that $e$ must be a closed map, so $\gamma X = e[X]$ and $X$ is compact.
A: This is essentially Henno’s argument, but without relying on previous knowledge of compactifications. Added: And it may be the argument that you found. (I had this tab sitting open and didn’t notice your second edit before posting.)
Let $\mathscr{B}$ be a base for $X$, and for each $B\in\mathscr{B}$ let $x_B\in B$; by normality there is a continuous $f_B:X\to[0,1]$ such that $f_B(x_B)=1$ and $f_B[X\setminus B]=\{0\}$. For each $B\in\mathscr{B}$ let $I_B$ be a copy of $[0,1]$, and let $Y=\prod_{B\in\mathscr{B}}I_B$ with the product topology. Finally, let
$$h:X\to Y:x\mapsto\langle f_B(x):B\in\mathscr{B}\rangle\,.$$

*

*Show that $h^{-1}[\{y\in Y:y_B\in U\}]$ is open in $X$ for each $B\in\mathscr{B}$ and open $U\subseteq I_B$. Conclude that $h$ is continuous and therefore by hypothesis closed.

*Use the fact that $\mathscr{B}$ is a base for $X$ to show that $h$ is injective.

*Conclude that $h$ is a homeomorphism of $X$ onto $h[X]$.

Now $h[X]$ is a closed subset of the compact space $Y$, so $h[X]$ is compact and therefore so is $X$.
