Hi so the question is asking if if there is a continuous function over $(0,1)$ which will result in the image $[0,1]$. Thank you so much! Explanations are greatly appreciated!
-
1Is the image supposed to be $[0,1]$ as indicated in the title, or $(0,1)$ as indicated in the question? – Oct 14 '16 at 05:10
-
Emm, how about $x \mapsto x$? You need to experiment just a little bit. – copper.hat Oct 14 '16 at 05:17
-
Or, to answer the title question, $x \mapsto {1 \over 2} (1+\sin (2 \pi x))$? – copper.hat Oct 14 '16 at 05:19
-
u the image is supposed to be [0,1] sorry! – cupcakelover1016 Oct 14 '16 at 05:28
-
Have a look at this question: Continuous function from $(0,1)$ onto $[0,1]$. – Martin Sleziak Oct 14 '16 at 14:13
8 Answers
you may consider the function $f(x)=\frac{\cos{(100x)+1}}{2}$. Surely it is continuous and reaches its maximum and minimum several times in $(0,1)$.
Hope I helped.

- 633
Assuming the image desired is $[0,1]$ (including the endpoints) an example continous function on $(0,1)$ would be $$ f(x) = \left\{ \begin{array}{cl} 0 & x < \frac14 \\ 2x-\frac12 & \frac14 \leq x \leq \frac34 \\ 1 & x > \frac34 \end{array}\right. $$ This function is continuous and has the desired image.
A much tougher question is whether there can be a function that is infinitely differentiable that maps this open interval onto its closure. One of the other answers shows that even this is possible.

- 41,743
\begin{align*} f(x)=\begin{cases} 0, & \text{ if $x<1/4$,} \\ 2(x-1/4), & \text{if $1/4 \leq x \leq 3/4$,} \\ 1, & \text{ if $x>3/4$.} \end{cases} \end{align*}
EDIT: Similar to previous answer. If you want to get creative with a similar idea...
\begin{align*} f(x)=\begin{cases} sin(2(x-1/4)\pi), & \text{if $1/4 \leq x \leq 3/4$,} \\ 0, & \text{ else.} \end{cases} \end{align*}

- 361
- 1
- 4
-
If you correct your mistake in the second line (which makes the function discontinuous and the image include points slightly greater than $1$, this is the same function I used in my answer. – Mark Fischler Oct 14 '16 at 05:20
-
Great minds think alike, although some less error prone. Will change to different example – Logician6 Oct 14 '16 at 05:23
HINT: Let $f$ be any bijection from $(0, 1)$ to $(-1, 2)$. This "spills over" the interval $[0, 1]$, so what you want to do is take the parts where it spills over and "fold them back." Do you see how to do this?

- 245,398
Assuming you mean the range to be $[0,1]$ as the title says, $f(x)=\frac{1+ sin(2 \pi x)}{2}$ has $f((0,1))=[0,1]$.

- 76,497
There are many examples of such functions. Take for example $f:(0,1) \to [0,1]$, $x \mapsto \sin^2(4 \pi x)$.
You cannot have a continuous bijection, however. Then you would have a continuous bijection $f^{-1}:[0,1] \to (0,1)$ but the preimage of the open $(0,1)$ is $[0,1]$, absurd.

- 12,462
Draw a zigzag line in the $xy$-plane as follows. Start at $(0,0);$ go in a straight line to $(\frac13,1);$ then straight to $(\frac23,0);$ then straight to $(1,1).$ This is the graph of a continuous function on $[0,1].$ (You didn't say it had to be differentiable, did you?) Erase the endpoints $(0,0$ and $(1,1)$ and it's a continuous function on $(0,1).$ What's the image?

- 78,265
Consider the piecewise function: \begin{cases} 2x, \qquad &\text{ for } 0 < x < \frac{1}{2}, \\ 1, &\text{ otherwise. } \end{cases}
EDIT: Oops, thought we wanted the image to be $(0, 1]$. To get the appropriate answer, consider: \begin{cases} 4x, \qquad &\text{ for } 0 < x < \frac{1}{4}, \\ 1 - 4(x - \frac{1}{4}) = 2 - 4x, &\text{ for } \frac{1}{4} < x \leq \frac{1}{2}, \\ 0, &\text{ otherwise.} \end{cases}