Why this function is continuous and not differentiable at point $x=1$ I have a function $$f(x) = \begin{cases}x^2+2,& x\leq 1\\x+2 ,& x > 1\end{cases}$$
I have to show that this function is continuous and not differentiable at point $x=1$, but when I look for left and right derivative of my function I get that they are equal. Can anybody have some  other idea?
 A: By definition of derivative, the problem requires one to show that the following limit exists: $$\lim_{x\to 1}\frac{f(x)-f(1)}{x - 1}$$
The limit exists if and only if the following one-sided limits exist and are of equal value: $$\lim_{x\to 1^-}\frac{f(x)-f(1)}{x - 1}$$ and $$\lim_{x\to 1+}\frac{f(x)-f(1)}{x - 1}$$
Based on the definition of limit, the first one-sided limit exists if and only if $$\exists L_1 : \forall \varepsilon : \exists \delta : \forall x < 1 : 1-\delta < x < 1 \longrightarrow \left|\frac{f(x)-f(1)}{x-1}-L_1\right| < \varepsilon$$
Similarly, the second one-sided limit exists if and only if $$\exists L_2 : \forall \varepsilon : \exists \delta : \forall x > 1 : 1 < x < 1 + \delta \longrightarrow \left|\frac{f(x)-f(1)}{x-1}-L_2\right| < \varepsilon$$
Then, derivative at $x = 1$ exists if and only if the one-sided limits exist and $L_1 = L_2$.
You can work out each of the mathematical logic statements to arrive at the conclusion that $L_1 = 2$ and $L_2 = 1$. Hence, the derivative at $x = 1$ does not exist because the one-sided limits do not agree.
A: Left-hand derivative of $f(x)$=$Lf'(x)$ 
$=\lim_\limits{h\to 0^-}\frac{f(1+h)-f(1)}{h}$ 
$=\lim_\limits{h\to 0^+}\frac{f(1-h)-f(1)}{-h}$ 
$=\lim_\limits{h\to 0^+}\frac{(1-h)^2+2-3}{-h}$ 
$=\lim_\limits{h\to 0^+}\frac{h^2-2h}{-h}$ 
$=\lim_\limits{h\to 0^+}(2-h)=2$ 
AND 
Right-hand derivative of $f(x)$=$Rf'(x)$ 
$=\lim_\limits{h\to 0^+}\frac{f(1+h)-f(1)}{h}$ 
$=\lim_\limits{h\to 0^+}\frac{(1+h)+2-3}{h}$ 
$=\lim_\limits{h\to 0^+}\frac{h+3-3}{h}$ 
$=\lim_\limits{h\to 0^+} 1=1$ 
Since $Lf'(x) \not = Rf'(x)$, so the function $f(x)$ is not differentiable at $x=1$.
A: Speaking geometrically, you can see some shape of the graph: it is evident that $f$ is continuous at $x=1$ but it can't be differentiable because there are infinitely many tangents to the graph at the corresponding point $(1,3)$ so the conclusion.On the other hand, --analytically now-, right-hand derivative gives $1$ and left-hand derivatives gives $2$. Your calculation must be wrong.

A: It's really simple:
$(x^2+2)'$ $= 2x$ and$ (x+2)' = 1$, then when you evaluate them for $x=1$, you get $2 $ and $1$. Since they are different, your $f$ is not differentiable at $x=1$.
A: Note $f$ is continuous everywhere except perhaps 1, since it is a composition/product of continuous functions. $f$ is continuous at $x=1$ $\iff$ $\lim_{x\to1^+}f(x)=\lim_{x\to1^-}f(x)$. Let's check that:
$$\lim_{x\to1^+}x+2=3$$
$$\lim_{x\to1^-}x^2+2=3$$
So our $f$ is is continuous at $x=1$.
To check differentiable at $x=1$ you must look at left and right derivative. $f$ is differentiable at $\iff \lim_{x\to1^+}\frac{f(x)-f(1)}{x-1}=\lim_{x\to1^-}\frac{f(x)-f(1)}{x-1}$.
Let's check that:
$$\lim_{x\to1^+}(\frac{x^2+2x-3}{x-1}=\frac{x^2-1}{x-1}=x+1)=2$$
$$\lim_{x\to1^-}(\frac{x+2-3}{x-1}=\frac{x-1}{x-1})=1$$ 
But $1\neq2$ so our function is not differentiable at $x=1$ so that means that our function $f$ isn't in $C^1(R).$ 
