This answer is factually incorrect: see the comments below.
Let $a$ be any root of $f(x)$. Then $a^3 - 3a + 1 = 0 \Rightarrow a^2 - 3 = -1/a \Rightarrow a^2 - 2 = -1/a +1$. Thus $g(a) = -1/a + 1$.
Let us find $g(g(g(a)))$, which is $g(g(-1/a + 1)) = g\left(-\frac{1}{-1/a+1} + 1 \right) = g\left(\frac{-a}{-1+a} + \frac{-1+a}{-1+a} \right) $ $ = g\left(\frac{-1}{-1+a}\right) = \frac{-1}{-1/(-1+a)} +1 = -1+a+1=a$. From this process, the roots of $f(x)$ in terms of $a$ are $a$, $-\frac{1}{a} + 1$ and $\frac{-1}{1+a}$. This means that cycling any root three times through $g(x)$ gives the original root, and these are the only three roots, since a cubic polynomial has at most three real roots.
The tricky part is the condition that $\alpha > \beta > \gamma$, where $\alpha$ is the largest root. In other words, how do we know that the cycling order isn't actually $\alpha, \gamma, \beta$? Observe that $(\alpha, \beta, \gamma)$, $(\beta, \gamma, \alpha)$ and $(\gamma, \alpha, \beta)$ represent the same cyclic permutation, and the other permutation $(\alpha, \gamma, \beta)$ also makes up three permutations, and because there are only $3! = 6$ in total, these are the only permutations.
So if the other permutation $(\gamma, \beta, \alpha)$ is true, then $\beta > \alpha$ (any other inequality would also hold for $(\gamma, \alpha, \beta)$), or $-\frac{1}{\alpha} + 1 > \alpha$, which leads to $\alpha < 0$ (*). By Descartes' rule of signs, $f(-x) = -x^3 + 3x + 1$ has one sign change, hence there is only one negative root. However, since there are three real roots from the question, the other two roots are positive ($0$ is not a root). Therefore $\alpha$ is not the largest root: contradiction, and the cycling order is $\alpha, \beta, \gamma$. Hence proved.
(*) Rearrange to get $\frac{1}{a} < 1- a$ as the inequality sign flips. You will have to split it into positive and negative cases to prove this algebraically, but this can be shown by a sketch.
I haven't actually shown that the values that $g(x)$ cycles through are the roots of $f(x)$! Vieta's formulas can be used to do this: prove that $a + g(a) + g(g(a)) = 0$, and do the same for $\alpha \beta + \beta \gamma + \gamma \alpha$ and $\alpha \beta \gamma$.