Hyperbolic set such that its set of periodic points is not dense in it Let $f : M \rightarrow M$ be a $C^r$ diffeomorphism, $r \geq 1$, where $M$ is a Riemannian manifold. We say that an invariant set $\Lambda \subset M$ is hyperbolic if 


*

*At every point $p$ in $\Lambda$ the tangent space $T_p M$ splits as a direct sum $T_p M = E_p^s \oplus E_p^u$.

*Both $E_p^s$ and $E_p^s$ are $Df_p$-invariant, that is, $Df_p(E_p^s) = E_p^s$ and $Df_p(E_p^u) = E_p^u$

*There are constants $0<\lambda< 1$ and $C \geq 1$ independent of $p$ such that for all $n \geq 0$ $||Df^n_p(v)|| \leq C\lambda^n||v||$ for $v \in E_p^s$ and $||Df^{-n}_p(v)|| \leq C\lambda^n||v||$ for $v \in E_p^u$.


Many examples of hyperbolic sets, such as the Cantor sets for the quadratic family $F_{\mu} = \mu x(1-x)$ for $\mu > 4$ and the linear toral automorphisms have the property that they have a dense set of periodic points. Is there a hyperbolic set $\Lambda$ such that its set of periodic points is not dense in $\Lambda$?
 A: Let $f:M\to M$ be a $C^1$-diffeomorphism of a manifold with dimension $n\geq 2$. Suppose that there exists $p\in Fix(f)$ a fixed hyperbolic saddle for $f$, with hyperbolic directions $E^s(p)$ and $E^u(p)$. By the stable manifold theorem we know that the stable and unstable manifold of $p$ are immersed $C^1$-submanifolds, which we will denote by $W^s(p)$ and $W^u(p)$. Suppose also that there is a point $q\in (W^s(p)-\{p\}) \cap (W^u(p) - \{p\})$ such that
$$
T_qM = T_qW^s(p) \oplus T_qW^u(p),
$$
In other words, $q$ is a point of transverse intersection between the stable and unstable manifolds of $p$, this is called a homoclinic transverse intersection.
Observe that since $q\in W^s(p)$ we have that $f^n(q) \to p$ when $n$ goes to $+\infty$. Similarly, using that $q\in W^u(p)$, $f^{-n}(q) \to p$ when $n$ goes to $+\infty$, in particular $p$ is the unique point of accumulation of the orbit of $q$.
Take $\Lambda = \{p\} \cup orb(q)$, it is easily checked that $\Lambda$ is $f$-invariant. Now we will define a splitting $\tilde{E}^s \oplus \tilde{E}^u$ of $T_{\Lambda}M$: 


*

*On $p$ define $\tilde{E}^*(p) = E^*(p)$, with $*=s,u$;

*For $x\in orb(q)$ define $E^*(x) = T_xW^*(p)$, with $*=s,u$.


It is a good exercise to check that the splitting above gives a hyperbolic splitting over $\Lambda$. It is easy to see that the periodic points are not dense in $\Lambda$.
Now let me comment on the density of periodic points. A hyperbolic set is isolated if there is an open neighbourhood $U$ of $\Lambda$ such that 
$$
\Lambda = \bigcap_{n\in \mathbb{Z}} f^n(\overline{U}).
$$
In other words, if $\Lambda$ is the maximal invariant set of a certain neighbourhood. An invariant set $\Lambda$ is transitive if there is a point $x\in \Lambda$ with dense orbit.
Theorem: If $\Lambda$ is an isolated, transitive, hyperbolic set then the periodic orbits are dense in $\Lambda$.
You can see this for instance as a consequence of Corollary 6.4.19, in the book "Introduction to the modern theory of Dynamical Systems, of A. Katok and B. Hasselblatt.
Remark 1:
From all that I will say next you can find the precise definitions in the same book. This is just a consequence of two properties of hyperbolic sets, the shadowing and the expansivity properties. Those two properties combined allows one to approximate periodic pseudo-orbits by actual periodic orbits. The isolated condition just guarantees that such a periodic orbit is actually contained inside the hyperbolic set. The transitivity guarantees that one can obtain dense periodic pseudo-orbits, which will imply dense periodic orbits inside $\Lambda$.
Without the isolated condition one can also get such an approximation, but one cannot guarantee that the periodic orbits are contained in $\Lambda$.
Remark 2:
The set constructed in the example that I mentioned is transitive, but it is not isolated, this follows from the existence of horseshoes from transverse homoclinic intersections, you can see Theorem 6.5.5 in Katok-Hasselblatt's book.
Remark 3:
This theorem can be used to justify the linear Anosov example that you mentioned, since the entire manifold is a hyperbolic set, thus isolated, and is transitive. Just to mention, it is an open problem to know if every Anosov diffeomorphism is transitive or not. 
