Solution (source code)

= Solution

\b[False without a separation assumption.] Give $X=\{0,1\}$ the <indiscrete topology> $\{\varnothing,X\}$, and take $Y=\{0\}$. Both spaces are finite and hence <compact>, but $Y$ is not a <closed set> because $X\setminus Y=\{1\}$ is not open. In a <Hausdorff space>, a <compact subset> would be closed; that hypothesis is absent here.