Prove that if $f$ and $g$ be monotone functions on $\Bbb R$ such that $f$ is continuous and $g(x) = f(x)$ for all rational numbers $x$, then $g$ is also continuous on R.
Solution:
Assume $f$ and $g$ are monotone increasing. Suppose that $g$ is not continuous. That means $g(c) \gt f(c)$ or $g(c) \lt f(c)$ when $c$ is irrational.
Suppose, $g(c) \gt f(c)$. By the density of real numbers, we can find rational numbers $x \lt y \lt z$ such that: $$g(z) = f(z) \gt g(c) \gt g(y) = f(y) \gt f(c) \gt g(x) = f(x)$$ This implies that $c$ is between $x$ and $y$ and between $y$ and $z$ due to the fact that both $f$ and $g$ are monotone increasing. This is impossible. Therefore, $g(c)$ cannot be greater than $f(c)$. Similarly, $f(c)$ cannot be greater than $g(c)$.
Hence, we conclude that the supposition that $g$ is not continuous is false. $g$ must also be continuous.