I'd like to prove the nonexistence of a real analytic function, injective, nonsurjective that sends rationals to rationals. Is it a classical result ? If not, any hints on how to prove it ? Thanks in advance for you help.

$\begingroup$ Does the function sends all rationals to all rationals? $\endgroup$ – user16974 Sep 24 '11 at 22:48

2$\begingroup$ By continuity, it would be surjective, if it surjective on a dense subset! So not all rationals are in the image. $\endgroup$ – Marc Palm Sep 24 '11 at 22:58

$\begingroup$ I don't know the answer, but I do know that if you reduce realanalytic to continuous, there is a function (pick any order isomorphism from Q to the negative rationals, and extend it to R) $\endgroup$ – Richard Rast Sep 25 '11 at 0:23

$\begingroup$ If you drop analytic, take $ x / (1 + x) $ $\endgroup$ – Will Jagy Sep 25 '11 at 1:36

4$\begingroup$ According to the following paper, the statement in the question is not true. Given any two enumerable and dense sets in open intervals of the reals, there is a real analytic function giving a bijection between them: Analytic Transformations of Everywhere Dense Point Sets, Philip Franklin, Transactions of the American Mathematical Society, Vol. 27, No. 1 (Jan., 1925), pp. 91100. jstor.org/stable/1989166 $\endgroup$ – George Lowther Sep 25 '11 at 2:30
The statement in the question is not true. Given any two enumerable and dense sets in open intervals of the reals, there is a (complex) analytic^{1} function giving a bijection between them. See the following paper: Analytic Transformations of Everywhere Dense Point Sets, Philip Franklin, Transactions of the American Mathematical Society, Vol. 27, No. 1 (Jan., 1925), pp. 91100.
The analytic functions can be constructed along similar lines to the method outlined in this MO answer. Is a real power series that maps rationals to rationals defined by a rational function? Also see this mathforum.org discussion on the subject with plenty of links. A question on realanalytic functions
^{1} The analytic function can be chosen to be entire on the complex plane except for the obvious case where either of the ends of the real interval in the domain is bounded but the corresponding end in the range is unbounded, where the function must have a singularity.

$\begingroup$ Thanks to all who helped out...and especially for the last reference ! $\endgroup$ – christian aebi Sep 25 '11 at 9:11