Is there a continuous increasing function $ f : [0, \pi] \to [0, e] $ such that $ f(0) = 0, f(\pi) = e $ and $ f (q ) \in \mathbb{Q} $ for $ q \in \mathbb{Q} $ and $ f (q ) \in \mathbb{Q}^c $ for $ q \in \mathbb{Q}^c $? I think there should be, but I am unable to construct one.
Continuous function taking rationals to rationals
7
$\begingroup$
real-analysis
-
0I found a more straightforward solution: pick two increasing sequences of positive rational numbers $\{a_n : n \geq 1 \} $ and $\{b_n : n \geq 1 \} $ with $a_n \uparrow \pi $ and $b_n \uparrow e $ as $ n \to \infty $. Set $ a_0 = b_0 = 0 $. Now define, $$ f (x) = \begin{cases} b_n + \frac{(b_{n+1} - b_{n} ) (x - a_n) }{ (a_{n+1} - a_{n} ) } & \text{ if } a_n \leq x < a_{n+1}, n \geq 0 \\ e & \text{ if } x = \pi. \end{cases} $$ Easy to see that $ f $ defined above will satisfy the properties. – 2012-11-08