Given $E = \{f| f : \mathbb{R} \mapsto \mathbb{R}~\text{continue where} f(x) \in \mathbb{Q}, \forall x \in \mathbb{R}\} \\$
what is $E$ in simpler form?
This question came from regional olympiad of real analysis in our country. We have discussed this in class, and my friend said that all constant rational numbers of function is the answer, $E = \{f(x) = c | c \in \mathbb{Q}\} $ but his explanation can't be accepted by me because he just used definition of rational numbers and get the answer without much data to give. Do you have any idea?
Your friend is right. If $f\in E$ and $f$ is not constant, then there are two real numbers $x$ and $y$ such that $f(x)\neq f(y)$. Take an irrational number $z$ between $f(x)$ and $f(y)$. Then, by the intermediate value theorem, there's a $w\in\mathbb R$ such that $f(w)=z$. But this goes against the definition of $E$.