Pointwise period dynamic have zero entropy 
Question: Let $X$ be a compact metric space and $T$ a continuous self-mapping. Assume every $x\in X$, there exists $n=n(x)$ such that $T^nx=x$. Prove that the topology entropy $h_{\text{top}}(T)=0$.

Since $h(T^l)=lh(T)$, if $T$ is period, i.e. $T^l=\text{id}_X$, we know $h(T)=\frac{1}{l}h(\text{id}_X)=0$. Motivated by this, put $P_n=\{x: T^nx=x\}$, then each $P_n$ is closed and $X=\bigcup P_n$. So $T^{N!}$ will keep each $P_n$, $n\leq N$ fixed. So I try to use Variational principle, let $\mu$ be a $T$-invariant measure, and tend to prove $\forall \epsilon, h_{\mu}(T^{N!})<\epsilon$. But don't know how to continue.
 A: Edit: My previous alleged counter-example was flawed as pointed out in the comments.
I'll leave the first part as a partial answer.
If one can show that the entropy is finite, then the entropy must, in fact, be zero as shown below.
Suppose $T$ has finite entropy. We will use the Variational Principle as you intended and a property of measure-theoretic entropy.
Let $\mathcal{M}$ be the set of all probability measures on $X$ preserved by $T$. Then $h(T) = \sup_{\mu \in \mathcal{M}} h_{\mu}(T)$, where $h_{\mu}(T)$ is the measure-theoretic entropy w.r.t. $\mu$.
Let $A_N = \bigcup_{n=0}^N P_n$, where $P_n = \{x \colon T^nx = x\}$ as you defined.
Since $X = \bigcup_{N \geq 0} A_N$ and since $A_N$ is a nested increasing sequence, we know for any $\mu \in \mathcal{M}$ that $\lim_{N \rightarrow \infty} \mu(A_N) = 1$.
In particular, given any $\mu \in \mathcal{M}$, the set $A_N$ has non-zero measure for all sufficiently large $N$.
Also, each $A_N$ is invariant.
Here is a property of measure-theoretic entropies: denote by $\mu_{A_N}$ the conditional measure on $A_N$ and likewise $\mu_{X\backslash A_N}$.
Then
$$ h_{\mu}(T) = \mu(A_N) h_{\mu_{A_N}}(T|_{A_N}) + (1-\mu(A_N)) h_{\mu_{X\backslash A_N}}(T|_{X\backslash A_N}). $$
You know that $h_{\mu_{A_N}}(T|_{A_N}) = 0$ for all $N$ because $T|_{A_N}$ is periodic and that
$$ h_{\mu_{X\backslash A_N}}(T|_{X\backslash A_N}) \leq h(T|_{X\backslash A_N}) \leq h(T). $$
Thus,
$$ h_{\mu}(T) \leq (1-\mu(A_N)) h(T). $$
Taking the limit $N \rightarrow \infty$, we conclude $h_{\mu}(T) = 0$ for any $\mu \in \mathcal{M}$ and, hence, $h(T) = 0$ as desired.
A: Thanks for Florian's answer. Motivated by him, there is a way that can prove $h(T)=0$, without assuming that $h(T)<\infty$.
We still use  Variational Principle. Since ergodic measures is exactly the endpoint of the the set of invariant measures, it's enough to establish $h_{\mu}(T)=0$ for all ergodic measures. One can check $T$ is a homemorphism, so each $P_n$ is $T^{-1}-invariant$. In particular, $\mu(T^{-1}P_n)=\mu(P_n)$. Because $\mu$ is ergodic, $\mu(P_n)=1$ or $0$. Also note that $X=\bigcup P_n$ (disjoint), so there exists unique $N$, such that $\mu(P_N)=1$. $T^N=\text{id}$ on $P_N$ implies $h_{\mu}(T)=0$.
