I'm stuck at a particular exercise in a textbook and would appreciate any help. The statement goes as follows: Let f and g be continuous on $\mathbb{R}$ to $\mathbb{R}$. Is it true that $f(x)=g(x)$ for x $\in \mathbb{R}$ if and only if $f(y)=g(y)$ for all rations numbers y in $\mathbb{R}$?
-
Background is always good on these sorts of questions: What have you tried? What are your thoughts on the problem? Where did you encounter it? Answering these will usually give you a better reception as well as, even more importantly, helping people to help you. – Apr 23 '14 at 06:54
-
See http://math.stackexchange.com/questions/536770/prove-if-fx-gx-for-each-rational-number-x-and-f-and-g-are-continuous, http://math.stackexchange.com/questions/505/can-there-be-two-distinct-continuous-functions-that-are-equal-at-all-rationals and other posts linked there. – Martin Sleziak May 02 '14 at 13:45
2 Answers
Clearly the one implication is true.
Suppose that they are equal over the rationals. For any $x\in\mathbb{R}-\mathbb{Q}$ irrational number, we can construct a sequence $x_n\in\mathbb{Q}$ such that it converges to $x_n\to x$. By continuity, we must have $f(x_n)\to f(x)$ and $g(x_n)\to g(x)$. But $f(x_n)=g(x_n)$ for all $n\in\mathbb{N}$ because all $x_n$ are rational. Therefore they converge to the same value, whence $$f(x)=g(x)\;\forall x\in\mathbb{R}$$
-
-
1No, clearly if $f(x)=g(x)$ for all $x\in\mathbb{R}$ then they are equal over the rationals as well. – Apr 23 '14 at 05:52
Hint
If $f(x)=g(x)$ for real numbers, then the same is true for rationals.
If $f(x)=g(x)$ for the rationals you can argue by contradiction: if there is a $y\in \mathbb R$ with $f(y)\neq g(y)$ use the fact that the rationals are dense in the reals to show that $f(x)-g(x)$ cannot be continuous (it is zero on the rationals).

- 100,194