Polynomial $P(x)$ with $P(x)\in\mathbb Q$ iff $x\in \mathbb Q$ 
Find all the polynomials $P \in \mathbb{R}[X]$ such that: $P(x) \in \mathbb{Q}$ if and only if $x \in \mathbb{Q}$.

I think $P(x)=x+c$ or $P(x)=-x+c$ where $c$ is some rational constant. But I have no idea approach this. 

Partial Answer: We can show that $P(x)$ can't be a quadratic with rational coefficients. In fact, $P(x)$ can't be a quadratic at all.

Let $P(x)=ax^2+bx+c$, for $a,b,c\in\mathbb{Q}$. Then $x=\frac{-b+\sqrt{m^2+1}}{2a}$, where $m\in\mathbb{Z}$, will be an irrational $x$ with a rational $P(x)$.


Constant coefficient, and Non-zero Coefficients
Clearly, any constant term, $c$, in the polynomial would need to be rational, since $P(0)=a\cdot0^2+b\cdot0+c=c$. We can set $c=0$ since it wouldn't affect whether a certain $P$ fits the criteria. Similarly, we can generate infinite families of polynomials by choosing different $c\in\mathbb{Q}$.
If $a=0$, then $P(x)=bx$, but we already know that linear equations fit our criteria. If $b=0$, then $P(x)=ax^2$ gives a rational value of $P(\sqrt{2})$ so $b\neq0$. Furthermore, if $a=b=0$, then $P(x)=0$ which is trivially rational for all irrational $x$. Hence, $a,b\neq0$ for all $P$ (not just quadratics).
Construction of $x=\frac{-b+\sqrt{m^2+1}}{2a}$
For any $a,b$, we can construct an irrational $x$ such that $P(x)$ is rational. The quadratic formula tells us that $x=\frac{-b\pm\sqrt{b^2-4a(-P(x))}}{2a}$. For $x$ to be irrational, $\sqrt{b^2-4a(-P(x))}$, must also be irrational. So we can choose an $m\in\mathbb{Z}$, $m\neq0$, such that $\sqrt{b^2-4a(-P(x))}=\sqrt{m^2+1}$, where the right-hand-side is irrational since $m^2+1$ can't be a square number. Rearranging this, we get $P(x)=\frac{m^2-b^2+1}{4a}$. We can also substitute $m$ into the expression for $x$ as $x=\frac{-b\pm\sqrt{m^2+1}}{2a}$.
Verification that $P(x)\in\mathbb{Q}$
We can verify this: when we compute $P(x)$, we get $$\begin{aligned}
P\left(\frac{-b+\sqrt{m^2+1}}{2a}\right)
&=a\left(\frac{-b+\sqrt{m^2+1}}{2a}\right)^2+b\left(\frac{-b+\sqrt{m^2+1}}{2a}\right)
\\&=\frac{1}{4a^2}\left(a(b^2-2b\sqrt{m^2+1}+c^2+1)+2ab(-b+\sqrt{m^2+1})\right)
\\&=\frac{1}{4a^2}\left(ab^2-2ab\sqrt{m^2+1}+a(m^2+1)-2ab^2+2ab\sqrt{m^2+1}\right)
\\&=\frac{a(m^2+1)-ab^2}{4a^2}
\\&=\frac{m^2-b^2+1}{4a}\end{aligned}$$.

Further Results
Combining this answer with @pisco125's Lemma 1, we see that $P(x)$ must have rational coefficients, meaning that it can't be a quadratic at all.
