• Let's put $f(X)=X^3-7X+7$, and $\color{red}{\varphi(X)=3X^2+4X-14}$; by developing, we obtain
$f(\varphi(X))= f(X)\times(27X^3 + 108X^2 - 45X - 377)$.
Hence $\varphi(p)$, $\varphi(q)$ and $\varphi(r)$ are roots of $f$.
Since $f(X)$ is irreducible in $\mathbb{Q}[X]$, the degrees of $p,q,r$ (over $\mathbb{Q}$) are 3.
None of these numbers is hence a root of $\varphi(X)-X$ (whose roots have degree ${}\leqslant2$), and we have $\varphi(z)\neq z$ for $z\in\{p,q,r\}$.
Then $\varphi(p)\in\{q,r\}$, $\varphi(q)\in\{p,r\}$, $\varphi(r)\in\{p,q\}$.
Now, $\varphi\big(\varphi(X)\big)=27X^4+72X^3-192X^2-320X+518$ and, using Euclid's algorithm, it can be checked that $\gcd\big((\varphi\circ\varphi)(X)-X,f(X)\big)=1$; thus no $z\in\{p,q,r\}$ is a root of $(\varphi\circ\varphi)(X)-X$, and we have $\varphi(\varphi(z))\neq z$.
In conclusion $\varphi(p)=q$, $\varphi(q)=r$, $\varphi(r)=p$.
• Finally there is another quadratic polynomial, namely $\color{blue}{\psi(X)=-3X^2-5X+14}$, that permutes $p,q,r$ the other way:
$\psi(p)=r$, $\psi(r)=q$ and $\psi(q)=p$.
(This time we'll get $f(\psi(X))=f(X)\times(-27X^3-135X^2-36X+379)$ and
$(\psi\circ\psi)(X)=-27X^4-90X^3+192X^2+445X-644$, etc.)
Edit (to answer the question of how $\varphi$ and $\psi$ were found).
In a rather ugly way… (And I'd like to see a more convincing proof).
I empirically computed $p\approx1.3568958679$, $q\approx-3.0489173395$ and $r\approx1.6920214716$.
From the relations $b=\frac{3a-1}2$ and $c=-\frac{14a}3$ I had the general form for $\varphi$, that is $\varphi(X)=aX^2+\frac{3a-1}2X-\frac{14a}3\cdot$
From $\varphi(p)=q$ comes the fact that $a=\frac{3(2q+p)}{6p^2+9p-28}\cdot$
Since the approximation obtained for $a$ was unexpectedly close to $3$, I suspected that $(a,b,c)=(3,4,-14)$.
All I had to do subsequently was a verification that this value for $\varphi(X)$ had all the expected properties.
As for $\psi(X)$ the corresponding value of $a$ is $\displaystyle\frac{3(2p+q)}{6q^2+9q-28}\approx-3$.