If you have a composite function, multiply it by the chain rule.
According to the image display,
When the independent variable is less than zero, the derivative is-1.
When the independent variable is greater than zero, the derivative is 1.
So just make a function that satisfies this condition.
The above two are
The derivative of the absolute value function is not derived, but fabricated, such as sgn(x)