You have $ |x-1|+|x+1|=\begin{cases} 2x,&\text{ if }x\geq1 \\2,&\text{ if }x\in(-1,1)\\ -2x,&\text{ if }x<-1\end{cases} $ so $ g(x)=|x-1|+|x+1|-mx-1=\begin{cases} 2x-mx-1,&\text{ if }x\geq1 \\2-mx-1,&\text{ if }x\in(-1,1)\\ -2x-mx-1,&\text{ if }x<-1\end{cases} $ For $g(x)=0$ we need:
- if $x\geq1$, $(2-m)x-1=0$ requires $1/(2-m)\geq1$ to have a zero, i.e. $1\leq m<2$.
- if $x\in(-1,1)$, $2-mx-1=0$, i.e. $mx=1$. This is $x=1/m\in(-1,1)$, so $|m|>1$.
- if $x<=1$, $(-2-m)x-1=0$ is $x=1/(-2-m)$; as $x\leq-1$, this is $1/(-2-m)\geq1$, i.e. $-2.
In conclusion: if $|m|<1$, there is no possible solution. If $m=1$, there is a single solution (from case 1); if $m=-1$, there is a single solution (from case 3); if $|m|\in(1,2)$, there is a solution from case 2 and another one from either cases 1 and 3.
In short, single solution if and only if $|m|=1$.
(it is a lot easier to understand all this if you draw a picture of $|x-1|+|x+1|$ and of $mx+1$)