1

Let $f: \mathbb{R} \to \mathbb{R}$ and $g: \mathbb{R} \to \mathbb{R}$ be continuous functions. Suppose that for all rational numbers $r$, $f(r) = g(r)$. Show that $f(x) = g(x)$ for all $x$.

2 Answers2

5

Strategy:

Consider $h(x)=f(x)-g(x)$. As the difference of two continuous functions, it is continuous. It is zero on all the rationals. You need to prove using continuity that is is also zero on the irrationals.

vadim123
  • 82,796
  • Details: Suppose $f(r) = c>0$ for some $r\in \mathbb{R}$, then by continuity of $f$ there exists $\delta>0$ such that $\forall x\in (r-\delta, r+\delta), \ |f(r) - f(x)|<c$, i.e. $f(x)>0$ on that interval, which contradicts the fact that all the rationals on that interval evaluates to zero. – chriseur Mar 17 '14 at 03:33
  • Did you mean "Suppose $h(r) = c > 0$ for some $r \in \mathbb{R}$? – Michael Coffey Mar 17 '14 at 06:36
0

I'm not sure if you are seeking hints or a full solution, but here is a sketch (I can fill in more details if you need):

  1. Note that rationals are dense in reals. So, for every real number $r$ there exists a sequence of rational numbers $\{q_k\}$ such that $\lim_{k\to \infty} q_k = r$.

  2. Now, use the fact that continuous means this in the language of sequences: if $f:\mathbb{R} \to \mathbb{R}$ continuous, then for any sequence $x_k\to x$ as $k\to \infty$, we have $f(x_k)\to f(x)$ as $k\to \infty$.

chriseur
  • 1,037