Continuity and differentiability on piecewise function

Let $$f(x)=\begin{cases}x^2-3, & x<0;\\-3, & x\geq 0.\end{cases}$$

(a) Find the value of $x$ where $f$ is discontinuous
(b) Find the value of $x$ where $f$ is non-differentiable

I know that the answers to (a) and (b) are NONE. But, could you please explain this so that I understand it better? Does the second condition, $(-3, \;\; x\geq0)$ redefine the first domain of the piecewise function, $(x^2-3,\;\;x<0)$?

Thanks

• You should only check the point $x=0$ by using the definition of derivative at $x=0$ you'll see that it is zero at that point. It is already differentiable for the points other than zero. Also differentiability implies continuity of the function at the point under question. – daulomb Sep 14 '14 at 1:21
• @user40615 OK, so if my $x$ value was for example, $2$ instead of $0$, I would check if the function is differentiable at $2$? Why is it differentiable at $0$ if $x^2-3$ doesn't exist at $0$, since it is an open interval? thank you. – Emi Matro Sep 14 '14 at 1:26
• remember the definition of the derivative. when $x=2$ your formula is just a constant function $f(x)=-3$. – daulomb Sep 14 '14 at 1:29
• @user40615 I am just confused about the open interval part of this problem, what difference does it make if it's open or closed? if it's $x \leq 0$ rather than $x<0$ thanks – Emi Matro Sep 14 '14 at 1:32
• Points for $x<0$ your function is polynomial function which is differentiable everywhere, so there is no problem, while points for $x>0$, it is a constant function, which is diff. everywhere too. The only thing to check the continuity and diff. at zero from the right and left of zero. – daulomb Sep 14 '14 at 1:42

The only place we need to worry about continuity/differentiability is when $x=0$, because on each of the intervals $(-\infty,0)$ and $(0,\infty)$, $f$ is equal to a single polynomial function (both $x^2-3$ and $-3$ are polynomials), and so it is continuous and differentiable on those intervals. On the other hand, in any open interval about $x=0$, the function $f$ is not a polynomial, so we have check it from the definition here.

Note that $f(0)=-3$, $$\lim_{x\to0^-}f(x)=\lim_{x\to0^-}x^2-3=-3,$$ and $$\lim_{x\to0^+}f(x)=\lim_{x\to0^+}-3=-3,$$ which shows that $f$ is continuous at $x=0$.

Also:

$$\lim_{h\to0^+}\frac{f(0+h)-f(0)}{h}=\lim_{h\to0^+}\frac{-3-(-3)}{h}=\lim_{h\to0^+}0=0$$

and

$$\lim_{h\to0^-}\frac{f(0+h)-f(0)}{h}=\lim_{h\to0^-}\frac{(0+h)^2-3-(-3)}{h}=\lim_{h\to0^-}\frac{h^2}{h}=\lim_{h\to0^-}h=0$$

Therefore $$\lim_{h\to0}\frac{f(0+h)-f(0)}{h}=0$$

so, since $f$ is continuous at 0, and this limit exists, $f$ is also differentiable at 0.