Find all polynomials that fix $\mathbb Q$ and the irrationals Problem: Describe all polynomials $\mathbb{R}\rightarrow\mathbb{R}$ with coefficients in $\mathbb C$ which send rational numbers to rational numbers and irrational numbers to irrational numbers.
Take a polynomial $f=a_nx^n+a_{n-1}x^{n-1}+...+a_1x+a_0$, and assume $f$ satisfies the problem conditions.

Since $f(1),f(2),f(3),...,f(n)$ are all rationals, we can use them to get $n$ independent equations in the variables $a_i$. Then, we can solve for all the $a_i$ with linear algebra. Linear algebra tells us that this equation-solving uses only +,-,*, and /, so all coefficients $a_i$ of the polynomial must be rational.

Now, multiply $f$ by all the denominators of all the $a_i$ to get a new polynomial $g=b_nx^n+b_{n-1}x^{n-1}+...+b_1x+b_0$ with integer coefficients. Clearly $g$ satisfies the problem conditions as well.

Consider all values $x$ for which $g(x)$ is an integer. By the Rational Root Theorem, any such $x$ can be expressed as $\frac{k}{b_n}$ for some integer $k$. From this we deduce that any two values $x$ for which $g(x)$ is an integer are spaced at least $\frac{1}{b_n}$ apart.

But if the polynomial $g(x)$ has degree at least $2$, it attains arbitrarily large slope as $x$ goes to $\infty$. In particular, we can pick $x$ so large that $g(x+\frac{1}{b_n})&gt;g(x)+100$. But then $g$ attains many integer values between $x$ and $x+\frac{1}{b_n}$, violating the deduction in the previous paragraph. Therefore, $g$ has degree at most $1$.

After proving this, we are done: the only polynomials $f$ that work are the ones in the form $a_1x+a_0$, where both $a_1$ and $a_0$ are rational.
Any polynomial of the form $\prod (x-r_i)$, where the $r_i$ are rational, will do it. If a polynomial has an irrational root (i.e., the real or imaginary part is irrational), then it maps that irrational number to zero, which is rational.

Therefore, the polynomial must be of the form stated above.

This seems too easy and simple. So, what is wrong?