> Suppose f: ]0,1[ -> Reals is analytic at every point in > ]0, 1[ and that f(r) is rational for every rational r in > the domain of definition. > > Some examples: x|-> 1/x > x|-> P(x), P in Q[x], > x|-> 9/23* (1/(x^2 + 1)) > > The most general form I can come up with is: > > - P in Q[x], > > - T in Q[x], such that T has no zeros inside ]0, 1[ > > - Let f(x) = P(x)/T(x) . > > That's all I could think of. I chose the domain of definition > ]0, 1[ to be small, for example compared to the Reals . > > So I'm curious to know whether any other such functions > f exist. > > BTW: The set of all such f forms a Q-algebra, it seems.
In this same thread Robert Israel mentioned an earlier post of his:
Israel showed that there are c many analytic functions that map the rationals to the rationals and then points out that there are only countably many functions of the type you've described.
In case anyone has a further interest in this, I thought I mention a few papers related to this question.
 Philip Franklin, "Analytic transformations of everywhere dense point sets", Trans. Amer. Math. Soc. 27 (1925), 91-100. [Announced in Bull. Amer. Math. Soc. 30 (1924), 482.] [JFM 51.0166.01]
Theorem I (p. 94): "For any two enumerable linear point sets, each everywhere dense on an open interval, an analytic function can be found which maps the two intervals on one another, and effects a one to one correspondence between the point sets."
[[ NOTE: I don't believe that any of the following later references mention Franklin's paper ]]
 Paul Erdos, "Some unsolved problems", Michigan Math. J. 4 (1957), 291-300. [MR 20 #5157; Zbl 81.00102]
Problem #24 (p. 197): "Does there exist an entire function f, not of the form f(x) = a + bz, such that the number f(x) is rational or irrational according to as x is rational or irrational? More generally, if A and B are two denumerable, dense sets, does there exist an entire function which maps A onto B?"
 Fred Gross, "Research Problem #19", Bull. Amer. Math. Soc. 71 (1965), 853.
[[ Gross apparently asks essentially the same question, but I have not actually looked at this reference. Maurer claims that his result answers negatively the question Gross asked, but see Gross' comment at the end of the Zbl review of Maurer's paper (URL given in  below). ]]
Theorem: "Let A and B be two countable dense sets in the complex plane. Then there exists an entire function taking A onto B."
 Karl F. Barth and Walter J. Schneider, "Entire functions mapping countable dense subsets of the reals onto each other monotonically", J. London Math. Soc. (2) 2 (1970), 620-626. [MR 42 #4729; Zbl 201.09203] http://www.emis.de/cgi-bin/Zarchive?an=0201.09203
MR (by W. D. Maurer): "This paper provides further information about a problem due to Erdos concerning the existence of functions mapping arbitrary countable dense sets onto others. The reviewer [Proc. Amer. Math. Soc. 18 (1967), 269-270; MR 35 #6829] showed that, given any two countable dense subsets of the complex plane, there exists an entire function taking one of these onto the other. In this paper we are talking about the line, not the plane, but the conclusion is stronger: the function takes points of the first countable dense set, and only such points, into points of the second one. The argument is very tedious and, in fact, is not completely carried out; only the case in which both of the given sets are the rationals is completed (the function involved in this case, however, is transcendental, as it is in the general case). As an application, the authors prove that strictly monotone increasing entire functions may assume any sequence of values whatsoever at all positive integers, just so long as these values themselves form an increasing sequence."
 Stuart Rankin and Daihachiro Sato, "Entire functions mapping countable dense subsets of the reals onto each other monotonically", Bull. Aust. Math. Soc. 10 (1974), 67-70. [MR 49 #10883; Zbl 275.30020]
MR (by T. Kovari): "By modifying a technique of W. D. Maurer, the authors give a new proof of the following result of K. F. Barth and W. J. Schneider: Let A and B be countable dense subsets of the real line; then there exists a transcendental entire function f such that the restriction of f to the real line is a real homeomorphism, and f(A) = B."
 Emil A. Corena, "Problem #10361", Amer. Math. Monthly, 101 (1994), 175.
"Do there exist nonlinear C^1 functions f:R --> R such that for any rational x, f(x) is also rational and for any irrational x, f(x) is also irrational?"