3
$\begingroup$

Let $f:[0,1] \to [0,1]$. Suppose $f$ attains every value between $0$ and $1$ in the interval $[0,1]$, then does it mean that $f$ is continuous in the interval $[0,1]$?

The cosine function came to my mind in this example, but this example might have a counter-example. Can you help me?

$\endgroup$
3
  • 4
    $\begingroup$ Consider the function $f(x)=2x$ if $x\in [0,1/2]$, $f(x)=0$ if $x\in (1/2,1]$ $\endgroup$
    – lulu
    Dec 24, 2017 at 21:59
  • $\begingroup$ Well, I think this question has been thoroughly answered. $\endgroup$
    – Joel
    Dec 24, 2017 at 22:32
  • $\begingroup$ Intuitively, we like to think functions are continuous because we draw continuous ones on the board, but most functions are not $\endgroup$ Dec 25, 2017 at 0:52

6 Answers 6

5
$\begingroup$

Take $f(x) = \begin{cases} 2x,\quad &x \in \left[0,\dfrac 12\right]\\ 1-\frac{x}{2},\quad &x\in\left(\dfrac 12,1\right] \end{cases}$

$f$ is not continuous at $\frac{1}{2}$, but takes all the values between $0$ and $1$.

$\endgroup$
3
$\begingroup$

Take the Conway Base 13 Function $\mod 1$. This guy takes every value between $0$ and $1$ on any interval in $[0,1]$, and yet is not continuous.

$\endgroup$
1
$\begingroup$

$f(x)=2x$ ,$ x\in[0,1/2)$, $f(x)=2x-1, x\in [1/2,1]$ is a counterexample.

$\endgroup$
1
$\begingroup$

Just to add to the list here, consider: $$f(x) = x\cdot\left(1-\frac{|x-1/2|}{x-1/2}\right).$$

Or to take this example a slight step further:

$$f(x) = \frac{\lambda}{2} \cdot x\cdot\left(1-\frac{|x-1/\lambda|}{x-1/\lambda}\right).$$ for any $0 < \lambda < 1$.

$\endgroup$
1
$\begingroup$

For a simple one discontinuous at every point except $x=\frac 12$, let $I_{\Bbb Q}(x)$ be the Dirichlet function, which is $1$ if $x$ is rational and $0$ if $x$ is irrational. Now let $$f(x)=xI_{\Bbb Q}(x)+(1-x)(1-I_{\Bbb Q}(x))$$ It is $y=x$ on the rationals and $y=1-x$ on the irrationals.

$\endgroup$
0
$\begingroup$

Define $f:[0,1] \to [0,1]$ as $$ f(x)= \begin{cases} x,\quad &x \in \left[0,\dfrac 12\right]\\ \frac 32-x,\quad &x\in\left(\dfrac 12,1\right] \end{cases} $$

Then $f$ is onto but discontinuous at $\frac 12.$

$\endgroup$

You must log in to answer this question.