Let $d(x,y)=|x-y|$, when does $|x-y|^p$ define a metric?

The only thing we need to check is the triangle inequality, i.e. for what $p$, do we have \begin{align} |x-y|^p \leq |x-z|^p+|z-y|^p. \end{align} It's clear that for $p>1$ the above inequality fails because \begin{align} 2^p=|1-(-1)|^p< |1-0|^p+|0-(-1)|^p = 2. \end{align} Suppose $0<p\leq 1$, then we see the triangle iequality does hold. Let us prove it. Observe \begin{align} |x+y| \leq (|x|+|y|)= (|x|^{p/p}+|y|^{p/p}) \leq (|x|^p+|y|^p)^{1/p} \end{align} which means \begin{align} |x+y|^p \leq |x|^p+|y|^p. \end{align} Lastly, for $p<0$, we see that $1/|x-y|^{|p|}$ doesn't satisfies the condition $d(x, x) = 0$.