Let's consider the case of the circle. Your example, continuously extended to the projective line (i.e. the circle) by $f(-1) = \infty$ and $f(\infty) = 1$ really is a continuous function satisfying $f(f(f(x))) = x$.
Let $f$ be any continuous function of the circle satisfying $f(f(f(x))) = x$ but not $f(x) = x$ identically. Suppose $a$ is not a fixed point. Then, $a$, $b = f(a)$, and $c = f(b)$ are three different points.
Since $f$ is continuous and invertible, I claim that it must send the directed arc $ab$ (the one that doesn't pass through $c$) to the directed arc $bc$, and also $bc \mapsto ca$ and $ca \mapsto ab$.
I assert that every continuous function on the circle satisfying $f(f(f(x))) = x$ identically that is not $f(x) = x$ is of the above form. Conversely, any choice of $a, b, c$ and choice of invertible orientation preserving maps $ab \mapsto bc$ and $bc \to ca$ has this property.
In particular, each such function has no fixed points.
Now, back to the line. If $f$ is a continuous function satisfying $f(f(f(x))) = x$, then it is invertible, and we can extend it to a continuous function of the circle by $f(\infty) = \infty$. This also satisfies $f(f(f(x))) = x$ and has a fixed point -- therefore $f$ satisfies $f(x) = x$.
In the end, it's probably the same underlying idea as mercio had, but I still thought it interesting to treat the circle anyways.