Decide if set of value can be image of continuous function $f:[0,10]\cup[12,20)\to\mathbb{R}$ is continuous.  Decide if following sets of values can be image of $f$
a. $[0,1]$
b. $[0,1]\cup (3,5)\cup \{7\}$
c. $(0,1)$   
a. is easy, for example $f(x) = \frac{1}{10}x,\ \ x\in [0,10]$ and $f(x)=\frac12\ \ \ \ x\in [12, 20)$
b. It is not possible.  Image of $f$ can have at most two intervals on its image.
c. No idea about this question. Can you help me, plesae ?
 A: You're right about a and b.
For c, we need to leverage the fact that the domain of $f$ has an open end into two open ends in the image. First off, let $f(x) = 1/2$ for $x \in [0,10]$.
Now, for $x \in [12, 20)$, take a look at $\sin^2(\frac1{x-20})$. It oscillates faster and faster as $x \to 20$ (check this link for a better look at what happens close to $x = 20$).
Unfortunately, the image of that sine is exactly $[0,1]$. We need to "dampen" the oscillations so that the tops never really reach $1$ and the bottoms never really reach $0$, but so that they come closer and closer for each oscillation. This may be done by, for instance, multiplying by $e^{x-20}$. Thus we get $f(x) = e^{x-20}\sin^2(\frac1{x-20})$ for $x \in [12,20)$.
A: For c. we can define $g$ to be any constant you like on $[0,10],$ and $g(x) = (1/(20-x))(\sin(1/(20-x))$ for $x\in [12,20).$ Then $g$ is continuous on $D = [0,10] \cup [12,20).$ Note that on $[12,20),$ $g$ takes on arbitrarily large positive and negative values. By the intermediate value theorem it follows that $g(D) = \mathbb R.$ The function 
$$f(x) = \frac{1}{\pi}(\arctan g(x) + \pi/2)$$
then maps $D$ continuously onto $(0,1).$ 
