Let $X$ be a compact topological space with continuous map $f\colon X\to X$. $Y:=\bigcap_{n\in\mathbb{N}}f^n(X)\subseteq X$ is closed and hence compact itself.
Assume $\overline{A}=Y$, i.e. $A$ is be dense in $Y$.
Does this imply $\overline{A}=X$, i.e. that $A$ is dense in $X$?
If $Y$ is a proper subset of $X$, so $X \neq Y$, then $A$ is certainly not dense in $X$. The closure cannot both be $Y$ and $X$ at the same time...
"$A$ dense in $Y$" implies $A \subseteq Y$ and so $\overline{A} \subseteq \overline{Y} = Y \neq X$.