I'm looking for a simple example in discrete dynamical systems whose periodic points set is not necessary closed.


I've seen some example in websites but they are not that simple and discrete.


Note that :



> 
> $(X,f)$ is a Dynamical System if $f:X \to X$ is a homeomorphism and $X$ is a compact metric space.
> \begin{align}
> Per(f):=\{x \in X ; f^n(x)=x ,\text{ for some } n \in \mathbb{Z}\}
> \end{align}
> 
> 
> 


For example I found this example :


Let $X$ be the unit disk $\{z\in\Bbb C: |z|\le 1\}$ and $f:X\to X$, $x\mapsto xe^{|x|i}$. Then $Per(f)=\{x\in X: |x|/\pi\in\Bbb Q\}.$


But It's not discrete and also It's not that simple to me to see why the periodic points is that and why it is not closed.


Could you please help me find a simple example with this property in discrete dynamical systems ?



Construct a homeomorphism whose periodic points set is not closed
Answering based on the comments of mine and YCor. This answer is also a duplicate of the answer to [the same question on Math.SE](https://math.stackexchange.com/questions/3993791/construct-a-homeomorphism-f-such-that-perf-is-not-closed/3993916#3993916).


Consider the space of infinite strings on a finite alphabet (so $\{1,2,\ldots,n\}^{\mathbb{Z}}$), and let $f$ be a shift function, either to the left or to the right. The space is a compact space when endowed with the product topology, and in fact it's a metric space with $d(s\_1,s\_2) = e^{-|n|}$ where $n$ is the smallest index at which two strings $s\_1$ and $s\_2$ differ. The set of periodic points for $f$ is clearly a dense space, consisting of all periodic strings. It's also not closed, since any nonperiodic string can be approximated arbitrarily well by a periodic one.


