已知函数 $f\left(x\right)=\begin{cases}\dfrac{1}{x+1}-3,&x\in\left(-1,0\right], \\ x,&x\in\left(0,1\right], \end{cases}$ 且 $g\left(x\right)=f\left(x\right)-mx-m$ 在 $\left(-1,1\right]$ 内有且仅有两个不同的零点,则实数 $m$ 的取值范围是( )
A.$\left(-\dfrac94,-2\right]\cup \left(0,\dfrac12\right]$
B.$\left(-\dfrac{11}{4},-2\right]\cup \left(0,\dfrac12\right]$
C.$\left(-\dfrac94,-2\right]\cup \left(0,\dfrac23\right]$
D.$\left(-\dfrac{11}{4},-2\right]\cup \left(0,\dfrac23\right]$
答案 A.
解析 方程 $g(x)=0$,即\[m=\begin{cases} \dfrac{1}{(x+1)^2}-\dfrac{3}{x+1},&x\in (-1,0],\\ \dfrac{x}{x+1},&x\in (0,1],\end{cases}\]也即\[m=\begin{cases} -\dfrac{3x+2}{x^2+2x+1},&x\in (-1,0],\\ \dfrac{x}{x+1},&x\in (0,1],\end{cases}\]也即\[m=\begin{cases} -\dfrac{9}{(3x+2)+\dfrac{1}{3x+2}+2},&x\in (-1,0],\\ \dfrac{x}{x+1},&x\in (0,1],\end{cases}\] 如图,实数 $m$ 的取值范围是 $\left(-\dfrac94,-2\right]\cup \left(0,\dfrac12\right]$.