I have the following question from an exam
If $(X, d_X)$ is compact, show that every sequence in $X$ has a subsequence converging to a point of $X$. Deduce that the projection map $\pi$ then has the property that, for any closed subset $F \subset X \times Y$, the image $\pi(F)$ is closed in $Y$. Give an example to show that this fails if $(X, d_X)$ is not assumed compact.
I was able to do the first two parts just fine, however, I am struggling to find a counter example to the last part. I think that it is due to an unease with dealing with the open and closed sets in the product topology. That is, whenever I make up some product topology I find it hard to immidietly tell if a set is open or closed, even if it the product topology as simple components.
Regardless, I tried to construct a counter example. First I thought of some the graph of some curve, however, if the curve is continuous then I will never be able to find an example as desired.
I am getting the sense that this problem will be hard with $\mathbf{R}$, however, I am not sure what other space to try.
Question: How does one think of the last part of the problem and what is such an example?