1. rational continuity

Suppose that the function f : R → R is continuous and that f (x) = 0 if x is rational. Prove that f (x) = 0 for all x in R

Now, I know that if f is continuous at x =a and {xn} is a sequence that converges to a, then { f (xn)} converges to f (a). But where does the rational part of the question come into play?

2. Chuse a sequence of rational numbers which converges to a.

3. If you like you could prove the more general: let $\displaystyle f,g:X\to Y$ be continuous functions between topological spaces and suppose Y is Hausdorff. If f and g agree on a dense subset of X, they agree on all of X.

4. Suppose for some c that f(c) isn't equal to 0. We can assume, without loss of generality, that f(c) > 0. By continuity there is an open neighborhood about c such that f(x) > 0 for all x in that neighborhood. Now use the denseness of the rationals.

5. The below is more just a note of passing interest.

If you like you could prove the more general: let $\displaystyle f,g:X\to Y$ be continuous functions between topological spaces and suppose Y is Hausdorff. If f and g agree on a dense subset of X, they agree on all of X.
Yes! The above is totally correct that is because if we define $\displaystyle A(\varphi,\psi)=\left\{x:\varphi(x)=\psi(x)\right\ }$ and $\displaystyle \varphi\oplus\psi:X\to Y\times Y$ by $\displaystyle \varphi\oplus\psi:x\mapsto(\varphi(x),\psi(x))$ then the continuity of $\displaystyle \varphi,\psi$ easily implies the continuity of $\displaystyle \varphi\oplus\psi$. Thus, one notes that since $\displaystyle Y$ is Hausdorff that $\displaystyle \Delta\subseteq Y\times Y$ is closed and $\displaystyle A(\varphi,\psi)=\left(\varphi\oplus\psi\right)^{-1}(\Delta)$ and so $\displaystyle A(\varphi,\psi)$ is closed. So, if $\displaystyle D\subseteq \subseteq A(\varphi,\psi)\subseteq X$ is dense then $\displaystyle X=\overline{D}\subseteq\overline{A(\varphi,\psi)}= A(\varphi,\psi)$ and so $\displaystyle X=A(\varphi,\psi)$. But! By definition this means that $\displaystyle \varphi(x)=\psi(x),\text{ }\forall x\in X$ or that $\displaystyle \psi=\varphi$!

Maybe more intuitive is to notice that $\displaystyle \mathbb{R}$ is a topological group (with the usual addition and usual topology). And since given a topological group $\displaystyle G$ the map $\displaystyle \alpha:G\times G\to G$ given by $\displaystyle \alphag,h)\mapsto gh^{-1}$ is continuous. Thus, one notes that $\displaystyle \varphi\oplus\psi:G\to G\times G$ is continuous and thus so is $\displaystyle \alpha\circ(\varphi\oplus\psi):G\to G$ with $\displaystyle g\mapsto \varphi(g)(\psi(g))^{-1}$. So, noticing that $\displaystyle A(\varphi,\psi)=\left\{g\in G:\varphi(g)=\psi(g)\right\}=\left\{g\in G:\varphi(g)(\psi(g))^{-1}=e\right\}$$\displaystyle =\left(\alpha(\varphi\oplus\psi)\right)^{-1}(\{e\}) and thus the above claim is true if \displaystyle \{e\} is closed in \displaystyle G. And since \displaystyle \{0\} is closed in \displaystyle \mathbb{R} the conclusion follows! (notice that the above paragraph is a farce since \displaystyle \{e_G\}\text{ is closed }\implies G\text{ is }T_1\implies G\text{ is }T_2) 6. No need for a cannon when a flyswatter works. Theorem: If a continuous function \displaystyle f is either positive or negative at \displaystyle x=a then \displaystyle f(x) has the same sign on some open interval \displaystyle (a-\delta,a+\delta). So if \displaystyle f(b)\not= 0 then \displaystyle f(b) is either positive or negative . But in any interval about \displaystyle b there is a rational number. That contradicts the theorem. HOW? 7. but then there must be f(x)=0 b/c rationals are everywhere dense. So, f(x)=0 at least once 8. Originally Posted by Drexel28 Yes! The above is totally correct that is because if we define \displaystyle A(\varphi,\psi)=\left\{x:\varphi(x)=\psi(x)\right\ } and \displaystyle \varphi\oplus\psi:X\to Y\times Y by \displaystyle \varphi\oplus\psi:x\mapsto(\varphi(x),\psi(x)) then the continuity of \displaystyle \varphi,\psi easily implies the continuity of \displaystyle \varphi\oplus\psi. Thus, one notes that since \displaystyle Y is Hausdorff that \displaystyle \Delta\subseteq Y\times Y is closed and \displaystyle A(\varphi,\psi)=\left(\varphi\oplus\psi\right)^{-1}(\Delta) and so \displaystyle A(\varphi,\psi) is closed. So, if \displaystyle D\subseteq \subseteq A(\varphi,\psi)\subseteq X is dense then \displaystyle X=\overline{D}\subseteq\overline{A(\varphi,\psi)}= A(\varphi,\psi) and so \displaystyle X=A(\varphi,\psi). But! By definition this means that \displaystyle \varphi(x)=\psi(x),\text{ }\forall x\in X or that \displaystyle \psi=\varphi! Maybe more intuitive is to notice that \displaystyle \mathbb{R} is a topological group (with the usual addition and usual topology). And since given a topological group \displaystyle G the map \displaystyle \alpha:G\times G\to G given by \displaystyle \alphag,h)\mapsto gh^{-1} is continuous. Thus, one notes that \displaystyle \varphi\oplus\psi:G\to G\times G is continuous and thus so is \displaystyle \alpha\circ(\varphi\oplus\psi):G\to G with \displaystyle g\mapsto \varphi(g)(\psi(g))^{-1}. So, noticing that \displaystyle A(\varphi,\psi)=\left\{g\in G:\varphi(g)=\psi(g)\right\}=\left\{g\in G:\varphi(g)(\psi(g))^{-1}=e\right\}$$\displaystyle =\left(\alpha(\varphi\oplus\psi)\right)^{-1}(\{e\})$ and thus the above claim is true if $\displaystyle \{e\}$ is closed in $\displaystyle G$. And since $\displaystyle \{0\}$ is closed in $\displaystyle \mathbb{R}$ the conclusion follows!

(notice that the above paragraph is a farce since $\displaystyle \{e_G\}\text{ is closed }\implies G\text{ is }T_1\implies G\text{ is }T_2$)

This is a fascinating proof. Its so algebraic :] I'm not sure I understand it all! I had thought of this low-tech one: suppose D is dense in X and there is a point a at which f and g differ. Use the Hausdorff property to pick disjoint open sets U and V containing f(a) and g(a) respectively. Then $\displaystyle f^{-1}(U)\cap g^{-1}(V)$ is open in X so it meets D, at d say, and f(d)=g(d). But then f(d) is in both U and V, a contradiction.

Here is something I have wondered before but been unable to prove: can we relax the condition that Y is T2? Are there distinct functions agreeing on a dense set that take values in a (say) T1 space? Do you know?

Let $\displaystyle X$ be $\displaystyle \mathbb{N}$ with the cofinite topology and define $\displaystyle \varphi,\psi:X\to X$ by $\displaystyle \varphi(x)=\begin{cases} x & \mbox{if}\quad x\ne 0 \\ 1 & \mbox{if}\quad x=0\end{cases}$. Then, if $\displaystyle O\subseteq X$ is open and thus infinite then $\displaystyle \varphi^{-1}(O)$ is infinite and thus open. Similarly, define $\displaystyle \psi(x)$ to be the identity map. Then, they agree on $\displaystyle \mathbb{N}-\{0\}$ which is dense since given any point $\displaystyle x\in X$ and any neighborhood of $\displaystyle x$ that neighborhood must infinitely many points and thus a point different from both $\displaystyle x$ and $\displaystyle \{0\}$.