Let $X$ a compact metric space and $f: X \longrightarrow X$ a continuous map. The map $f$ is said to be transitive if for every pair of non-empty open sets $U, V \subset X$ there exists an integer $n$ such that $f^n(U) \cap V \ne \emptyset$.
My question: If $f$ is transitive, it must be surjective? I suspect the answer is yes, but I'm not sure of how to prove it.
Hint: Observe that $f(X) ∩ V ≠ ∅$ for every non-empty open $V$.