Does a continuous function $f: [0,1] \cup [2,3] \to [5,6]$ exist? 
Does a continuous function $f: [0,1] \cup [2,3] \to [5,6]$ exist?

I have been trying to solve this problem and I could think of such function. I am still new to the concept of the continuity of a function and I am simply too puzzled to answer whether this function is continuous or not. On the one hand, intuitively, it is hard for a function to be more discontinuous than this, but as I try to work with the $\epsilon, \delta$ definition of continuity, it makes intuitive sense. Could you help me decide whether or not this function is continuous? Some simple clarification would be most appreciated. 
EDIT: My original question was not precise. $[5,6]$ is supposed to be the range of this function.

 A: Another example is this:
Consider $f: \mathbb{R} \to \mathbb{R}$ given by
$$f(x) = \frac{1}{3}x+5$$ 
It is continuous on $\mathbb{R}$.
Now restrict it to your domain $[0,1] \cup [2,3]$. 
Restricting the domain or the co-domain of a function does not affect its continuity.
A: The function you have provided is actually continuous. Take $\epsilon$ to be equal to $\delta$ and you will see that the definition of continuity is met at every point in the domain.  It looks not continuous at first glance (because the domain is not a connected set), but there is no violation of the definition of continuity. 
You will see with that definition that if the function is separately continuous over each connected component of the domain, then it is continuous over the whole domain. 
A: HINT:
Addition and multiplication are continuous operations.
The functions $\mathbb R \times \mathbb R \to \mathbb R$ given by $(x,y) \mapsto xy$ and $(x,y) \mapsto x+y$ are continous.
Can you modify these functions? What about, for example,  $(x,y) \mapsto \frac{1}{3}xy$ 
or $(x,y) \mapsto \frac{4}{3}x-\frac{3}{4}y$ ?
A: Yes, for example take the constant function $f(x) = 5$
The function you provided is also continuous. Although it may look discontinuous because the graph has two components, continuity is a local property of a function around each point of its domain. And near each point of $[0,1]\cup [2,3]$ your function is continuous. Any jump that appears is outside the domain of the function, and therefore doesn't impact its continuity.
Note that you didn't even need to arrange that $f(1)=f(2)$. It would still be continuous with lines of positive slope on both components. I'm not sure if you arranged the function to match on the endpoints because you thought it was necessary for continuity; it is not.
However the function that you have written is especially nice, because it can be recognized as the restriction of an absolute value function, which is manifestly continuous.
In general, a function is continuous on a domain if it is continuous on each connected component.
A: 
Take $$f(x) =\frac{1}{2}(6-\left|2x-3\right|)$$
A: For a continuous function that is onto [5,6]
f(x) = x + 5 if x in [0,1],
f(x) = 5 if x in [2,3].
