I know that the polynomial $f(x)=\frac{1}{2} x^2 + \frac{1}{2}x \in \mathbb{Q}[x] $ has that $f(\mathbb{Z})\subset\mathbb{Z}$.
My question is a bit different: Does there exist a polynomial $f \in \mathbb{R}[x]$ such that $f(\mathbb{Z}) = \mathbb{Q}$? What about a polynomial that $f(\mathbb{Q}) = \mathbb{Z}$?
I suspect that both polynomials do not exist, but I do not know how to prove it.