12. Given a function $f(x)=\left\{\begin{array}{l}m \sqrt{1-x^{2}}, x \in(-1,1], \\ 1-|x-2|, x \in(1,3],\end{array}\right.$ with period $T=4$ and $m>0$. If the equation $3 f(x)=x$ has exactly 5 real solutions, then the range of $m$ is
A. $\left(\frac{4}{3}, \frac{8}{3}\right)$
B. $\left(\frac{4}{3}, \sqrt{7}\right)$
C. $\left(\frac{\sqrt{15}}{3}, \frac{8}{3}\right)$
D. $\left(\frac{\sqrt{15}}{3}, \sqrt{7}\right)$
Solve:
As shown in the figure, when $y=\frac{x}{3}$ is tangent to $y=m \sqrt{1-(x-4)^{2}}$,
$$
\begin{array}{l}
\frac{x^{2}}{9}=m^{2}\left[1-(x-4)^{2}\right] \Rightarrow\left(9 m^{2}+1\right) x^{2}-72 m^{2} x+135 m^{2}=0, \\
\Delta_{1}=72^{2} m^{4}-4 \cdot 135 m^{2} \cdot\left(9 m^{2}+1\right)=0 \Rightarrow 9 m^{2}=15 \Rightarrow m=\frac{\sqrt{15}}{3} ;
\end{array}
$$

When $y=\frac{x}{3}$ is tangent to $y=m \sqrt{1-(x-8)^{2}}$,
$$
\begin{array}{l}
\frac{x^{2}}{9}=m^{2}\left[1-(x-8)^{2}\right] \Rightarrow\left(9 m^{2}+1\right) x^{2}-144 m^{2} x+567 m^{2}=0, \\
\Delta_{2}=144^{2} m^{4}-4 \cdot 567 m^{2} \cdot\left(9 m^{2}+1\right)=0 \Rightarrow m^{2}=7 \Rightarrow m=\sqrt{7} .
\end{array}
$$

In summary, the range of $m$ is $\left(\frac{\sqrt{15}}{3}, \sqrt{7}\right)$, so the answer is $D$.