$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.
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\;,$$
which is an infinite discrete space and therefore not compact.
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.