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.
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\,.$$
Now $h[X]$ is a closed subset of the compact space $Y$, so $h[X]$ is compact and therefore so is $X$.