If polynomial with rational number is injective on rationals then it is injective on reals?

Let $p:\Bbb{R}\to\Bbb{R}$ is polynomial with rational coefficients. If restriction of $p$ to $\Bbb{Q}$ is injective, then $p$ is injective?

I conjectured that $p$ is monotonic, but I don't know how to prove this conjecture. Thanks for any help.

• I suspect $x^3 - 2 x$ is injective on $\mathbb Q.$ Jul 5 '13 at 1:56
• @willjagy This would answer the question if it is true. Do you have a proof that the restrition of $x^3-2x$ to the rationals is injective ?
– Amr
Jul 5 '13 at 2:08
• Working on it... Jul 5 '13 at 2:10
• Answered three years ago on MO (the answer is no). mathoverflow.net/a/27231/297 Jul 5 '13 at 2:27

Answering this CW, using the clever technique of Hailong Dao on MO, pointed out by David Speyer in comment above. We have $$f(x) = x^3 - 2 x.$$ Now, if we have distinct rational $x,y$ such that $$f(x) = f(y),$$ we have $x - y \neq 0$ and $$x^2 + x y + y^2 = 2.$$ We can then take a positive integer $t$ as the least common multiple of the denominators of $x,y,$ so that $$u = t x, \; \; v = t y$$ are integers and $$\gcd(u,v) = 1.$$ Then $$u^2 + u v + v^2 = 2 t^2.$$ However, $u^2 + u v + v^2$ is anisotropic in the 2-adic numbers. That is, since the result is even, it follows that $u,v$ are both even (Try it!). This contradicts $\gcd(u,v) = 1.$ So, actually $x=y.$
I had no idea that this was related to quadratic forms in this simple way. The number 2 can be replaced by any prime $q \equiv 2 \pmod 3.$ That is, $$x^3 - 2 x, \; \; x^3 - 5 x, \; \; x^3 - 11 x, \; \; x^3 - 17 x, \; \; x^3 - 23 x, \; \; x^3 - 29 x, \; \; x^3 - 41 x$$ are all injective on the rationals.
The more familiar way is to say Legendre symbol $(2|3) = -1.$
Note that $u^2 + u v + v^2$ is one of Pete L. Clark's ADC forms, because it is one of his Euclidean forms. That is, $u^2 + u v + v^2$ represents an integer $n$ over the rationals if and only if it represents $n$ over the integers. If you are checking this property for some $n,$ note that you also need to check $u,v$ with opposite signs as well, to be sure.