Need help in the continuity question

73 Views Asked by At

could someone please explain to me the following question:

Let $f,g$ be continuous functions from $\mathbb{R}$ to $\mathbb{R}$ and suppose that $f(r) = g(r)$ for all $r \in \mathbb{Q}$. Is it true that $f(x) = g(x)$ for all $x \in \mathbb{R}$?

My claim is that it should be true since $f$ and $g$ are continuous from $\mathbb{R}$ to $\mathbb{R}$, so if $f(x) \neq g(x)$ for all $x \in \mathbb{R}$ then it cant be continuous on $\mathbb{R}$?

So, is my claim correct and if it is how am I supposed to prove it (please give me some hints) Also, if my claim is wrong, could you please explain to me as to why its wrong`

4

There are 4 best solutions below

4
On

Yes, the functions coincide :). If you wish, you can use the following fact from topology: if $f,g:X\to Y$, where $Y$ is Hausdorff ($X$ and $Y$ are topological spaces of course), are continuous, then the set $\{x\in X| \ f(x) = g(x)\}$ is closed in $X$. How to apply it here? Note that if $f(q) = g(q)$ for all rational $q$, then the set $\{x\in \mathbb{R}| \ f(x) = g(x)\}$ contains $\mathbb{Q}$ and at the same time must be closed... Hence it coincides with $\mathbb{R}$ (clearly $\mathbb{R}$ is Hausdorff)! ;)

If you don't want to use this fact from topology, you can proceed as follows. Take any $x\in\mathbb{R}\backslash\mathbb{Q}$. Take any sequence of rational numbers $\{q_n\}_{n\in\mathbb{N}}$ with $\lim_{n\to\infty} q_n = x$ (such sequence can clearly be chosen). Then according to your condition, $f(q_n) = g(q_n)$ for all $n$. Hence, $f(x) = f(\lim_{n\to\infty} q_n) = \lim_{n\to\infty} f(q_n) = \lim_{n\to\infty} g(q_n) = g(\lim_{n\to\infty} q_n) = g(x)$ (the first and the last equalities are due to continuity of $f$ and $g$...). And you're done.

4
On

Assume there is some $x$ where $f(x)\neq g(x)$ Let $\epsilon=|f(x)-g(x)|/3$ Apply the definition of continuity-all the values at rational points within $\delta$ nearby can't be that close to $f(x)$ and $g(x)$

5
On

Hint:

You might want to use the following facts:

  1. $f$ is continuous at $x$ if and only if for every sequence $x_n \to x$ we have $f(x_n)\to f(x)$.

  2. for every $x\in \mathbb R$ there exists a sequence $\{x_n\}\subseteq \mathbb Q$ such that $x_n \to x$.

0
On

Yes, they are equal on $\mathbb{R}$.

An easy way to see this is to note that for a continuous function $f$, and a sequence $x_n \rightarrow x$, it is the case that $f(x_n) \rightarrow f(x)$.

For every $x \in \mathbb{R}$, you can find a sequence of rationals $q_n \rightarrow x$. Since $f$ and $g$ are continuous, and $f(q_n) = g(q_n)$ for each $q_n$, it follows that $f(x) = g(x)$.


To prove that if $x_n \rightarrow x$ then $f(x_n) \rightarrow f(x)$;

Let $\epsilon > 0$.

Since $f$ is continuous, $\exists \delta > 0 $ s.t. $\lvert f(x) - f(y) \rvert < \epsilon$ whenever $\lvert x - y \rvert < \delta$.

Then as $x_n \rightarrow x$, $\exists N$ such that $\lvert x_n - x \rvert < \delta$ whenever $n > N$.

Hence whenever $n > N$ we have $\lvert f(x) - f(x_n) \rvert < \epsilon$, and therefore $f(x_n) \rightarrow f(x)$.