[Math] Can there be two continuous real-valued functions such that at least one has rational values for all x

gn.general-topologyreal-analysis

Of course, no continuous real valued non-constant function can attain only rational or irrational values, but can there be a pair of nowhere-constant continuous functions f and g such that for all x, at least one of f(x) and g(x) is rational? Or maybe a countable collection of continuous functions, {f1, f2…} such that for all x there is n such that fn(x) is rational?

Thanks

Best Answer

If you allow the functions to be constant on some intervals, then there are some easy examples, and Ricky has provided one.

But if you rule that out, then there can be no examples, even with countably many functions. To see this, suppose that $f_n$ is a list of countably many continuous functions which are never constant on an interval. Enumerate the pairs $(r,n)$ of rational numbers $r$ and natural numbers $n$ in a countable list $\langle (r_0,n_0), (r_1,n_1),\ldots\rangle$. Let $C_0$ be any closed interval. If the closed interval $C_i$ is defined, consider the function $f_{n_i}$ and the rational value $r_i$. Since $f_{n_i}$ is not constant value $r_i$ on $C_i$, we may shrink the interval to $C_{i+1}\subset C_i$ such that $f_{n_i}$ on $C_{i+1}$ is bounded away from $r_i$. By compactness, there is some $x\in C_i$ for all $i$. Thus, $f_n(x)$ is not $r$ for any rational number $r$.

Related Question