Maps preserving algebraic numbers

Suppose $f:\mathbb{C}\to\mathbb{C}$ is a map with your favorite smoothness condition (say, $C^1, C^{\infty}$ or holomorphic) and suppose that $f(\overline{\mathbb{Q}})\subset\overline{\mathbb{Q}}$. Is $f$ a polynomial? (I.e., if you chose $C^1$ or $C^{\infty}$ in the beginning, then is $f$ a polynomial in $z$ and $\overline{z}$, and if you chose holomorphic, then is $f$ a polynomial in $z$?)

I imagine this is a well-known problem, but I don't remember having seen it before. A holomorphic counter-example would be quite impressive, though I doubt such a thing exists.

-
The same sorts of arguments used to answer this question: mathoverflow.net/questions/48910/… also answer yours. Basically, given dense, countable sets $A,B\subset \mathbb{C}$, there is an entire function which takes $A$ to $B$. –  David Cohen Oct 19 '11 at 3:28

This is indeed very well-known. There are plenty of counterexamples. In fact, there's a remarkable construction due to van der Poorten of a "transcendental" entire function $f$ such that $f$ and all its derivatives map any algebraic number $\alpha$ into $\mathbb Q (\alpha)$. See

A.J. van der Poorten, Transcendental entire functions mapping every algebraic number field into itself, J. Austral.Math. Soc. 8 (1968), 192–193.

-

$f : \mathbb{C} \to \mathbb{C} \:$ given by $\: f(z) = 0 \:$ shows that $f$ can be a polynomial.

This answer show that $f$ can be holomorphic and not a polynomial.

Unless I'm missing something, that answer works just as well
to show that $f$ can be an entire function and not a polynomial.

-