$$
\begin{array}{l}
\text { 2. If } f(g(x))=\sin 2 x, \\
g(x)=\tan \frac{x}{2}(0<x<\pi),
\end{array}
$$

then $f\left(\frac{\sqrt{2}}{2}\right)=$ $\qquad$
2. $\frac{4 \sqrt{2}}{9}$.

Notice that,
$$
\begin{array}{c}
f(g(x))=\sin 2 x=2 \sin x \cdot \cos x \\
=2 \cdot \frac{2 \tan \frac{x}{2}}{1+\tan ^{2} \frac{x}{2}} \cdot \frac{1-\tan ^{2} \frac{x}{2}}{1+\tan ^{2} \frac{x}{2}} .
\end{array}
$$

Then $f\left(\frac{\sqrt{2}}{2}\right)=2 \times \frac{\sqrt{2}}{1+\frac{1}{2}} \times \frac{1-\frac{1}{2}}{1+\frac{1}{2}}=\frac{4 \sqrt{2}}{9}$.