2

Am I going in the right direction?

Suppose that $f: \mathbb{R} \to \mathbb{R}$ is continuous on $\mathbb{R} $ and that $f(r)=0$ for every rational number $r$. Prove that $f(x)=0$ for all $x$ in $\mathbb{R}$.


Proof:

Since $r \in \mathbb R $, then $\forall \epsilon \gt 0$, $\exists \delta \gt 0$ such that if $\lvert x-r \rvert \lt \delta$ $\forall x \in \mathbb R $, then $\lvert f(x)-f(r) \rvert = \lvert f(x) \rvert \lt \epsilon$.

Since $\lvert f(x) \rvert \lt \epsilon$, it follows that $f(x)=0$ $\forall x \in \mathbb R $.

Exit path
  • 4,328
J. Doe
  • 23
  • 1
  • 5
  • You need to use somehow the density of $\mathbb{Q}$ in $\mathbb{R}$. In other words, we know that for any $r \in \mathbb{R}$ there exists a sequence $(q_n)$ of rational numbers converging to $r$. Equivalently, given any interval $I$ with $r \in I$, the set $(I-{r}) \cap \mathbb{Q}$ is nonempty. – Exit path Nov 15 '17 at 03:36
  • The more general result: A continuous function between metric spaces is fully determined by its values on a dense subset. https://math.stackexchange.com/questions/610123/a-continuous-mapping-is-determined-by-its-values-on-a-dense-set – symplectomorphic Nov 15 '17 at 04:18

3 Answers3

3

Since $\mathbb{Q}$ is dense in $\mathbb{R}$, for every real number $x \in \mathbb{R}$, there exists a sequence $(q_n)_{n=1}^\infty \in \mathbb{Q}$ such that $q_n \to x$ (for example, take the sequence of truncated decimal expansions). Then, by continuity, $$f(x) = f\left(\lim_{n \to \infty} q_n\right) = \lim_{n \to \infty}f(q_n) = \lim_{n \to \infty} 0 = 0.$$

Theo Bendit
  • 50,900
2

No, because you have not specified what $r$ is, in particular, $r$ is not necessarily a rational number, so $f(r)$ need not to be $0$. Rather, fix an irrational number $r$, since $f$ is continuous at $x=r$, given $\epsilon>0$, there exists some $\delta>0$ such that for all $x$ with $|x-r|<\delta$ we have $|f(x)-f(r)|<\epsilon$. Now choose a rational number $q$ such that $|q-r|<\delta$, plugging in, we have $|f(r)|=|f(q)-f(r)|<\epsilon.$ Since the latter inequality is true for all $\epsilon>0$, one has $|f(r)|=0$, so $f(r)=0$.

user284331
  • 55,591
0

Consider a sequence $\{x_n\}\subset\mathbb{Q}$ which converges to $\alpha\in\mathbb{Q}^c$ then by continouty of function $\lim f(x_n)=0\Rightarrow f(\lim x_n)=0\Rightarrow f(\alpha)=0$ here $\alpha$ is arbitrary hence $f(x)=0$ for every real value