$\left|\sin(x)\right|$ derivative at $\pi$ Let $f$ be a function, $f:\mathbb{R}\to\mathbb{R}$

$$f(x)=\begin{cases} 
      e^{x^2}-2 &amp; x&lt; 0 \\
x^3+x-1 &amp; 0\leq x \leq 1 \\ 
     \left|\sin(x)\right|  &amp; x&gt;1. 
   \end{cases}$$

Check if $f$ is continuous and differentiable at $a$, when $a=0,1,\frac{\pi}{2}, \pi$. If $f$ is differentiable at $a$, find $f'(a)$.

What I've been doing:

I found that: 


$f$ is continuous at $0$ but not differentiable.
$f$ is not continuous at $1$ so it's not differentiable.


And then I thought that $f$ was differentiable at $\pi$ and $\frac{\pi}{2}$ because $f$ is continuous at $(1, +\infty)$ ($\left|\sin(x)\right|$), so I looked for:


$f'(\frac{\pi}{2})=\left|\cos(\frac{\pi}{2})\right|=0$ (by the solution my prof gave me this is correct).
$f'(\pi)=\left|\cos(\pi)\right|=-1$ Now this is wrong. The solution they gave me says that $f$ is not differentiable at $\pi$, and I'm really lost. Why is it differentiable at $\frac{\pi}{2}$ and not $\pi$?
$f$ behaves like $\sin(x)$ around $\frac{\pi}{2}$. It is differentiable.
$f$ behaves like $\sin(x)$ on the left of $\pi$ but it behaves like $-\sin(x)$ on the right.  We have to be more careful.
$f(\pi)=0$.
$\lim_{x \to \pi^-} \frac{f(x)-f(\pi)}{x-\pi}=\lim_{x \to \pi^-} \frac{f(x)-0}{x-\pi}=\lim_{x \to \pi^-} \frac{\sin(x)-\sin(\pi)}{x-\pi}=\cos(\pi)=-1$
$\lim_{x \to \pi^+} \frac{f(x)-f(\pi)}{x-\pi}=\lim_{x \to \pi^+} \frac{-\sin x-0}{x-\pi}=-\lim_{x \to \pi^+} \frac{\sin(x)}{x-\pi}=-\lim_{x \to \pi^+} \frac{\sin(x)-\sin(\pi)}{x-\pi}=-\cos(\pi)=1$


Hopefully this picture can help you, notice where the kink occurs.
The function can be treated as piecewise function when there is absolute function involved.
$$f(x)=\begin{cases} 
      \sin x &amp; 1&lt;x\le\pi\\
-\sin x &amp; \pi&lt; x \leq 2\pi 
   \end{cases}$$
So 
$$\lim_{x→\pi^-}f^\prime(x)→-1$$ while $$\lim_{x→\pi^+}f^\prime(x)→1$$ left gradient does not equal to right gradient, so it is not differentiable at $\pi$.