SOLVED

Is there an entire non-linear function $f$ such that, for all $x\in\mathbb{R}$, $x$ is rational if and only if $f(x)$ is?

More generally, if $A,B\subseteq \mathbb{R}$ are two countable dense sets then is there an entire function such that $f(A)=B$?

Solved by Barth and Schneider [BaSc70], who proved that if $A,B\subset\mathbb{R}$ are countable dense sets then there exists a transcendental entire function $f$ such that $f(z)\in B$ if and only if $z\in A$. In [BaSc71] they proved the same result for countable dense subsets of $\mathbb{C}$.