By definition we have $$|x|=\begin{cases} x \space\space\space\space\space\space\text{if $x\geq 0$}\\ -x \space\space\space\text{if $x< 0$}\end{cases}$$
Thus $$f'(x)=\begin{cases} 1 \space\space\space\space\space\space\text{if $x> 0$}\\ -1 \space\space\space\text{if $x< 0$}\end{cases}$$
$$=2\theta(x)-1$$ where
$$\theta(x)=\begin{cases} 1 \space\space\space\text{if $x> 0$}\\ 0 \space\space\space\text{if $x< 0$}\end{cases}$$
Next note that the derivative of the Heaviside's unit step function is the Dirac delta function.
You want to show that $f'(x)=2\theta(x)-1$, from the definition above we have $$f'(x)=\begin{cases} 1 \space\space\space\space\space\space\text{if $x> 0$}\\ -1 \space\space\space\text{if $x< 0$}\end{cases}$$
Do you agree with this?
Since we have defined $$\theta(x)=\begin{cases} 1 \space\space\space\text{if $x> 0$}\\ 0 \space\space\space\text{if $x< 0$}\end{cases}$$
then what can we do to $\theta(x)$ so that it gives $f'(x)$?
Well:
$$2\theta(x)=\begin{cases} 2 \space\space\space\text{if $x> 0$}\\ 0 \space\space\space\text{if $x< 0$}\end{cases}$$ so $$2\theta(x)-1=\begin{cases} 1 \space\space\space\text{if $x> 0$}\\ -1 \space\space\text{if $x< 0$}\end{cases}$$
which is $f'(x)$.