Proving a function has a discontinuity at 0 but continuous elsewhere

continuityreal numbersreal-analysissequences-and-seriessolution-verification

Let $f(x) = \left\{\begin{array}{ll} x + 2 & -3 < x < -2 \\ -x -2 & -2 \leq x < 0 \\ x + 2 & 0 \leq x < 1 \end{array}\right.$

I want to show that $f$ has a discontinuity at $x=0$ but is continuous at all other points in $(-3,1)$

Attempt:
If $f$ was continuous at $0$ then $\lim_{x \to 0}f(x) = f(0)$. Now $f(0) = 2$. Not sure how to then proceed. Do I just then say $\lim_{x \to 0}f(x) = x+2$ (since x = 0?)

Hence it is discontinuous at $x = 0$

For continuity at all other points: let $\epsilon > 0$ be given. Then there exists $ \delta > 0$ such that $|x – y| < \delta \Rightarrow |(x+2) – (y+2)| = |x – y| < \epsilon$ (let $\delta = \epsilon$).

Also there exists $\delta > 0$ such that $|x – y| < \delta \Rightarrow |-x -2 – (-y -2)| = |y – x| = |x – y| < \epsilon$.

Hence $f$ is continuous at all other points in $(-3,1)$.

Best Answer

For $x<0$, $f(x)=-x-2$ and $$l_{x<0}=\lim_{x\rightarrow0}f(x)=-2$$

For $x\geq0$, $f(x)=x+2$ and $$l_{x\geq0}\lim_{x\rightarrow0}f(x)=2\rightarrow$$

$$l_{x<0}\neq l_{x\geq0}$$

hence, the function has a discontinuity at$0$.