Is $f$ continuous or not continuous? Given a  function  $f\colon [0,1] \cup (2, 3] \to [0, 2]$ defined by 
$$f(x)=\begin{cases} x & 0 \le x \le 1 \\ x-1 & 2 < x \le 3 \end{cases}$$
My  question is that is  $f$ is  continuous  or not  continuous ?
My attempt  :  Suppose  if i take  $c=0$ , then  for  every $\epsilon >0$ , there  is exist $\delta$  such that  $|x-c| < \delta$  such that  $|f(x)-f(c)| <\epsilon$
But  here  $\lim_{ x\rightarrow 0^+}f(x)= -1$ and  $\lim_{x\rightarrow 0^{-}} = 0$
So  $f$  is  not continuous 
 A: You start with $\epsilon - \delta$ and then move to $\lim_{x \to 0 ^-}$ etc. : I don't get your approach because you either use limits or $\epsilon - \delta$ as methods, but you seem to use some convoluted combination of them and then get confused.
So you stick with one method.
For example, sticking with $\epsilon - \delta$ : Given $\epsilon > 0$, we note that for any $x \in [0,1] \cup (2,3) = S$, we have $S \cap B(x , \frac 12) \subset [0,1]$ or $S \cap B(x,\frac 12) \subset (2,3]$ , for example ($\frac 12$ is not special, anything less than one works). So, we can work with just these sets. 
Now, for any $x$ and $y \in S \cap B(x , \frac 12)$, observe that $|f(y) - f(x)| = |y-x|$ (from  definition of $f$ on both the pieces). Thus, we may take $\delta  = \min\{\frac 12 , \epsilon\}$, because $\delta < \frac 12$ will bring any $y$ into the same piece as $x$, then $\delta < \epsilon$ will ensure $|f(y) - f(x)| = |y-x|  < \delta = \epsilon$ in this piece. Thus, we are done by $\epsilon - \delta$.

If you wanted to argue via limits, then only one - sided limits can be spoken of at $0,1$ and $3$. For example, it is obvious that $\lim_{x \to 0^+} f(x) = \lim_{x \to 0^+} x = 0 = f(0)$ and similarly for $1$ and $3$. For the other points, the double sided limit can be argued similarly, depending on which the piece the point you take is in.
A: When trying to determine if a function is continuous you don't have to jump right into the formal definitions. Start off by graphing the function:

You now review the graphs of both continuous functions and ones with discontinuities in their domain. If this picture fits a known pattern in your collection, then you can hazard a guess before working out a more technical explanation.
If this is a new pattern, then ask if the output value $y$ in $y = f(x)$, as it 'lives' over $x$ in the domain, 'behaves'.
Here the domain consists of two disjoint intervals with 'space' between them. So the output values 'live' over one or the other 'separated' interval pieces.
