This question has already been answered, but I post this for correction of a false solution. Let $\pi_X:X \times Y \to X$ be the projection onto $X$. We wish to show that if $Y$ is compact, this is a closed map.
Let $F \subseteq X \times Y$ be closed. Then, $X \times Y \setminus F$ is open in the product space. Hence:
$$X \times Y \setminus F = \bigcup_I U_i \times V_i$$
where $U_i, V_i$ open in $X,Y$ respectively for each $i \in I$, where $I$ is some index set.
I think it is true that:
$$X \times Y \setminus (U_i \times V_i) = \Big((X \setminus U_i) \times Y\Big) \cup \Big(X \times (Y\setminus V_i) \Big)$$
$$ \implies F = \bigcap_I \bigg(\Big((X \setminus U_i) \times Y\Big) \cup \Big(X \times (Y\setminus V_i) \Big) \bigg)$$
$$ \implies F = \bigcap_I \Big((X \setminus U_i) \times Y\Big) \cup \bigcap_I \Big(X \times (Y\setminus V_i) \Big)$$
If $\bigcup_I Y \setminus V_i \neq \emptyset$, $\pi_X(F) = X$ which is closed in $X$. Otherwise, $\pi_X(F) = \bigcap_I X \setminus U_i$, which is also closed in $X$. But the argument hasn't used compactness, so it must be incorrect. I think the issue must lie in my last two expressions for $F$ -- I am not sure my manipulation of sets is correct.