Suppose $\operatorname{cl}(X)\not=Y$. We know $X\subseteq \operatorname{cl}(X)$ so we get $\operatorname{cl}(X)=X$ and $\infty \notin \operatorname{cl}(X).$ So by definition of closure, there exists a (wlog, open) neighborhood $U$ of $\infty$ s.t. $U \cap X=\emptyset$. The topology of the extension is defined to be all open subsets of $X$ together with all sets $V$ that contain $\infty$ and such that $X\setminus V$ is closed and compact. $\infty \in U$ so $U$ is of the second kind of open sets, meaning $X \setminus U$ is closed and compact. But remember that $U \cap X=\emptyset$ so $X\setminus U=X$. We get that $X$ is compact, in contradiction to the assumption (if $X$ was compact, we wouldn't have needed the compactification).