Proving that $f$ has points with prime period 3 
Exercise: Let $f:\mathbb{R}\longrightarrow\mathbb{R} $ be continuous, $n>3$, and $x_1,x_2,\cdots,x_n$ be points such that $x_1<x_2<\cdots<x_n$. Show that if $f(x_i)=x_{i+1}$ for $i\in\{1,2,...,n-1\}$ and $f(x_n)=x_1$, then $f$ has points with all prime periods.

Proof: $x_{n-3}$ and $x_{n-2}$ exist, because $n>3$. $f^3(x_{n-3})=x_n>x_{n-3}$ and $f^3(x_{n-2})=x_1>x_{n-2}$. If $g(x)=f^3(x)-x$, then $g(x_{n-3})=x_n-x_{n-3}>0 $ and $g(x_{n-2})=x_1-x_{n-2}<0$. $f(x)$ is continous, so $f^3(x)$ is continuous. $x$ is also continuous. Therefore $g(x)$ must be continuous. So we can use the intermediate-value theorem to conclude there exists a $c\in(x_{n-3},x_{n-2})$ such that $g(c)=0$. This means $f^3(c)=c$ for this $c$.
So $c$ is a period-3 point.
Question: We should now proof that $c$ is a prime-period 3 point. This means we should prove that $f(c)\neq c$. If we can do this, we can use Sarkovskii to complete the proof. But how can we prove this, if it's possible at all??
 A: The $c$ you've constructed thus far will not work in complete generality: it could well be the case that $f(c) = c$.
For $i < n-1$, let $I_i = [x_i, x_{i+1}]$. It suffices to show that there is a subinterval $\hat I_{n-3} \subset I_{n-3}$ with endpoints $\hat x_{n-3}, \hat x_{n-2}$ (ordered either way, it doesn't matter) such that $f(\hat I_{n-3}) = I_{n-2}$ and $f(\hat x_{n-3}) = x_{n-2}, f(\hat x_{n-2}) = x_{n-1}$. 
Then, you can apply your previous argument to the function $g(x) = f^3(x) - x$ restricted to the interval $\hat I_{n-3}$. This yields a point $c \in Interior(\hat I_{n-3})$ for which $g(c) = 0$, i.e. $f^3(c) = c$, and moreover, you know ahead of time that $f(c) \neq c$ since $f(\hat I_{n-3}) = I_{n-2}$ is disjoint from $Interior(\hat I_{n-3})$.

To find the subinterval $\hat I_{n-3} \subset I_{n-3}$: 
Observe that $f^{-1}(\{ x_{n-2}\}) \cap I_{n-3}$ and $f^{-1}(\{ x_{n-1}\}) \cap I_{n-3}$ are disjoint, closed subsets of $I_{n-3}$. The minimal distance between these two sets is achieved at some pair $\hat x_{n-3} \in f^{-1} x_{n-2}, \hat x_{n-2} \in f^{-1} x_{n-1}$. 
I now claim that the interval $\hat I_{n-3}$ with endpoints $\hat x_{n-3}, \hat x_{n-2}$ satisfies the desired properties. Let's assume $\hat x_{n-3} < \hat x_{n-2}$; although this need not be the case, the argument works much the same way in the alternative. Observe that by connectedness, $f(\hat I_{n-3}) \supset I_{n-2}$. To show the opposite inclusion, assume the contradiction hypothesis $f(\hat I_{n-3}) \setminus I_{n-2} \neq \emptyset$. Fix such a point $x^*$. 
If $x^*$ is to the right of $I_{n-2}$, then $f(\hat x_{n-3}) = x_{n-2} < x_{n-1}$ and $f(x^*) > x_{n-1}$, then there is some interior point $\hat x$ of $\hat I_{n-3}$ for which $f(\hat x) = x_{n-2}$ by the Intermediate Value Theorem. This contradicts minimality of $|\hat x_{n-2} - \hat x_{n-3}|$. Similarly, if $x^*$ is to the left of $I_{n-2}$, then $f(\hat x_{n-2}) = x_{n-1} > x_{n-2}$ and $f(x^*) < x_{n-2}$, and so there is some interior point $\hat x$ of $\hat I_{n-3}$ for which $f(\hat x) = x_{n-2}$, again contradicting minimality. Thus, no such $x^*$ can exist, and so we conclude $f(\hat I_{n-3}) = I_{n-2}$, as desired.
