TITLE: if $x^3-x\in\mathbb{Z}$ and $x^4-x\in\mathbb{Z}$ for some $x\in\mathbb{R}$, then $x\in\mathbb{Z}$.
QUESTION [5 upvotes]: Assume that $x^3-x\in\mathbb{Z}$ and $x^4-x\in\mathbb{Z}$ for some $x\in\mathbb{R}$.
Prove that $x\in\mathbb{Z}$.
my attempt:
Let $a=x^3-x$ and consider polynomial $X^3-X-a$, then $x$ is a root of it and if $x\in\mathbb{Q}$, then obviously $x\in\mathbb{Z}$.
But it doesn't give anything if $x\notin\mathbb{Q}$, so it's surely not the right way.

REPLY [6 votes]: Let $x^3-x=a$ and $x^4-x=b$.
Let's do a few steps of the Euclidean algorithm for polynomial GCD:
$x^4-x-b=x(x^3-x-a)+(x^2+(a-1)x-b)\\ \implies x^2+(a-1)x-b=0$
$x^3-x-a=x(x^2+(a-1)x-b)+((1-a)x^2+(b-1)x+a)\\ \implies (1-a)x^2+(b-1)x+a=0$
$0=(1-a)(x^2+(a-1)x-b)-((1-a)x^2+(b-1)x+a)$
$\implies x ((1-a) (a-1)-b+1)-(1-a) b-a=0$
and so $x$ is rational, unless $((1-a) (a-1)-b+1)=0$ and $(1-a) b-a=0$.
The last condition happens for integers $a$ and $b$ iff $a=b=0$, in which case $x=0$ or $x=1$.