0
$\begingroup$

Let $f: \mathbb{R} \to \mathbb{R}$ be continuous and $D \subset \mathbb{R}$ be a dense subset of $\mathbb{R}$. Furthermore, $\forall y_1,y_2 \in D \ f(y_1)=f(y_2)$. Should $f$ be a constant function?

My attempt: Since $f$ is continuous $$\forall x_0 \ \forall \varepsilon >0 \ \exists \delta>0 \ \forall x \in \mathbb{R} \ \left(|x-x_0|<\delta \Longrightarrow |f(x)-f(x_0)|<\varepsilon \right)$$ Let $f$ be non-constant function. Since $D$ is dense $\exists x_1 \in (x_0-\delta, x_0+\delta) \ : \ x_1 \in D$. Let's take $x_2 \in (x_0-\delta, x_0+\delta)$ such that $f(x_2) \ne f(x_1)$. Let $\varepsilon = \frac{|f(x_2)-f(x_1)|}{2}>0$. Therefore, we have $$|f(x_1)-f(x_0)|<\frac{|f(x_2)-f(x_1)|}{2} \ \ \ |f(x_2)-f(x_0)|<\frac{|f(x_2)-f(x_1)|}{2}$$ Adding the expressions above, we obtain $$|f(x_2)-f(x_1)|\le |f(x_1)-f(x_0)|+|f(x_2)-f(x_0)|<|f(x_2)-f(x_1)|$$ what is the contradiction. Are my mussings correct?

2 Answers 2

1

Your proof is flawed; you might not be able to take that $x_2$ since you have supposed only that $f$ is not constant, not that it is not constant in every interval $(x_0-\delta,x_0+\delta)$.

A quick way to prove what you want is: Let $x,y\in\mathbb{R}$. As $D$ is dense in $\mathbb{R}$ we can pick a sequence $(x_n)_n$ with $x_n\in D$ for every $n$ and $\lim_{n\to\infty}x_n=x$, and in the same fashion we can pick $(y_n)_n$ with $y_n\in D$ and $\lim_{n\to\infty}y_n=y$. Now, as $f$ is continuous and constant in $D$, we have $$ f(x)=\lim_{n\to\infty}f(x_n)=\lim_{n\to\infty}f(y_n)=f(y). $$ Since $x$ and $y$ were arbitrary this proves that $f(x)=f(y)$ for every $x,y\in\mathbb{R}$ and thus that $f$ must be constant.

  • 1
    In fact your proof is direct, you need not assume $f(x)\ne f(y)$.2017-02-06
  • 0
    @szw1710 You're right, I am editing it to avoid unnecessary contradictions.. ;)2017-02-06
  • 0
    I don't understand why people prefer $\varepsilon,\delta$ language. Maybe because this is the usual way to define a limit and continuity. Look at the original post. An attepmt is done in this way.2017-02-06
  • 0
    @szw1710 Well, I don't think people prefer the $\delta-\varepsilon$ languaje, but rather that it is more difficult for starters to think about convergence in topological terms. I myself try to avoid $\delta$'s and $\varepsilon$'s whenever possible. :)2017-02-06
  • 1
    @szw1710 I hate epsilon-delta language and the vast amount of solutions to problems solved like that 'Let us choose $\varepsilon$ so large that $\epsilon > \delta^2 \ln 456789$' I really don't understand :(2017-02-06
  • 0
    @NicholasS It can be confusing at first but the real objection, to me at least, is that it feels "aesthetically unpleasing". ;P2017-02-06
1

Why such $x_2$ does exist?

I propose what follows: Take $a,b\in\Bbb R$ and two sequences $(a_n),(b_n)$ of elements of $D$, distinct from $a,b$, respectively, with $a_n\to a$ and $b_n\to b$. Then $f(a_n)\to f(a)$ and $f(b_n)\to f(b)$. Hence $f(a)=f(b)$ because $f$ was constant on $D$.

In the $\varepsilon,\delta$ language: take any $\varepsilon>0$ and choose an appropriate $\delta$ to $\frac{\varepsilon}{2}$. Then choose two elements $a_1,b_1\in D$ with $|a-a_1|<\delta$ and $|b-b_1|<\delta$. You have $$|f(a)-f(b)|\le |f(a)-f(a_1)|+|f(a_1)-f(b_1)|+|f(b_1)-f(b)|<\varepsilon,$$because the middle term vanishes. Now tend with $\varepsilon$ to $0$ to get $f(a)=f(b)$.