Prove that $f(x)=|x-1|^n$ ($n \in \mathbb{N}$) is differentiable in $\mathbb{R}$ iff $n\ge2$
I tried to compare the limits of the derivative defintion at $x\to1^+$ and $x\to1^-$ but didn't manage. I think that's the (a) way to do it but I'm not sure on the specifics.
If $n=1$, then $\lim_{x\to1^+}\frac{f(x)-f(1)}{x-1}=1$ and $\lim_{x\to1^-}\frac{f(x)-f(1)}{x-1}=-1$. Therefore, $f'(1)$ does not exist.
If $n\geqslant2$, then$$\lim_{x\to1}\frac{|x-1|^n}{x-1}=\lim_{x\to1}\frac{|x-1|}{x-1}|x-1|^{n-1}=0,$$since $\frac{|x-1|}{x-1}$ is bounded and $\lim_{x\to1}|x-1|^{n-1}=0$.