Is Y a compact subset?

$X$ compact topological space, $f\colon X\to X$ continuous

Is then $Y:=\bigcap_{n\geqslant 1}f^n(X)\subset X$ compact?

Edit (based on the comments I got below):

The assumption that $X$ is Hausdorff is needed. So let's assume that. For each $n\geq 1$, $f^{n}(X)$ is compact and thus closed, and hence $Y$ is closed as intersection of closed sets.

Since $Y\subset X$ is closed and $X$ is compact, it follows that $Y$ is compact.

• Sounds good to me – marwalix Jun 2 '15 at 11:46
• I am only missing a "proof" why $f^n(X)^C, n\geq 1$, is open. – Salamo Jun 2 '15 at 11:47
• @Salamo: Not only for metric spaces, it works for Hausdorff topological spaces. Is $X$ not assumed to be Hausdorff? – Pedro M. Jun 2 '15 at 11:59
• @Salamo If $X$ is a Hausdorff topological space and $A \subset X$, if $A$ is compact then $A$ is closed in $X$. If $X$ is compact and $A$ is closed in $X$, then $A$ is compact. If $X$ is metrizable and $A$ is compact, then $A$ is bounded. – Laurent Hayez Jun 2 '15 at 11:59
• Hyothesis "Hausdorff" is needed, at least for this proof. (Of course in Bourbaki, "compact" includes Hausdorff in the definition.) – GEdgar Jun 2 '15 at 12:00

Your argument is fine if $X$ is Hausdorff. For the sake of completeness, here’s a non-Hausdorff counterexample. Let $X=\Bbb N\times\{0,1\}$, and for $i\in\{0,1\}$ let $X_i=\Bbb N\times\{i\}$. Points of $X_0$ are isolated. A set $U\subseteq X$ is an open nbhd of $\langle n,1\rangle\in X_1$ if and only if $\langle n,1\rangle\in U$ and $X\setminus U$ is finite. Then $X$ is compact and $T_1$ but not Hausdorff. Let
$$f:X\to X:\langle n,i\rangle\mapsto\begin{cases} \langle n,i\rangle,&\text{if }i=0\\ \langle n+1,i\rangle,&\text{if }i=1\;; \end{cases}$$
$f$ is not just continuous, but in fact a homeomorphism of $X$ onto $X\setminus\{\langle 0,1\rangle\}$. However,
$$Y=\bigcap_{n\ge 1}f[X]=X_0\;,$$
Intuitively, I just started with a convergent sequence together with its limit point and replaced the limit point by a countably infinite set with the cofinite topology. The map $f$ leaves the points of the sequence alone, but each iteration of it eliminates one more of the limit points.