How do I find the the derivative of $|x|^p$ for $x\in \mathbb{R}$ and $p\in [1,\infty)$ via the definition of the derivative? I know the derivative is equal to $px|x|^{p-2}$. If I use the answer to this question, I don't get to anywhere useful:
$$f(x)'=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}=\frac{|x+h|^p-|x|^p}{h}=\frac{(|x+h|^p-|x|^p)(|x+h|^p+|x|^p)}{h(|x+h|^p+|x|^p)}=\frac{|x+h|^{2p}-|x|^{2p}}{h(|x+h|^p+|x|^p)}$$
So I don't think myself that adopting the method from the question is correct. But then I can't think of any other way to get to the desired answer. Any help is appreciated.
Hint: Break it up into cases. $x>0$ and $x<0$ are trivial as once $h$ is sufficiently close to 0, so is $x+h$.
The $x=0$ case break into two one sided limits, one as $h\to 0^-$, the other $h\to 0^+$. This lets you get rid of the absolute value in your calculations.