We consider the following conditions for topological spaces $T,X$ and a map $f \colon T \to X$.
- $f$ is continuous.
- The graph $\Gamma_f := \{ (t,f(t)) \in T \times X \mid t \in T \} \subset T \times X$ is closed.
I already proved the following for a topological space $X$.
- If $X$ is Hausdorff, then 1 $\Rightarrow$ 2 for all topological space $T$ and all map $f \colon T \to X$.
- If 1 $\Rightarrow$ 2 for all topological space $T$ and all map $f \colon T \to X$, then $X$ is Hausdorff.
- If $X$ is compact, then 2 $\Rightarrow$ 1 for all topological space $T$ and all map $f \colon T \to X$.
Now I want to show the following.
Problem If 2 $\Rightarrow$ 1 for all topological space $T$ and all map $f \colon T \to X$, then is $X$ compact?
I know a map $f \colon \mathbf{R} \to \mathbf{R}$ such that $f$ is not continuous and $\Gamma_f \subset \mathbf{R} \times \mathbf{R}$ is closed. However, it is not enough to prove this problem.
Your question has been answered in
Joseph, James E. "On A Characterization of Compactness for T1 Spaces." The American Mathematical Monthly 83.9 (1976): 728-729.
In this short paper you can also find references to more comprehensive accounts.
However, you will need the requirement that $X$ is a $T_1$-space. Otherwise the result is not true.