22. (14 points) Given the sequence $\left\{x_{n}\right\}$,
$$
x_{1}=a, x_{n+1}=\frac{2 x_{n}}{1+x_{n}^{2}} \text {. }
$$
(1) Let $a=\tan \theta\left(0<\theta<\frac{\pi}{2}\right)$, if $x_{3}<\frac{4}{5}$, find the range of $\theta$;
(2) Define the function $f(x)$ on $(-1,1)$, for any $x, y \in(-1,1)$, there is
$$
f(x)-f(y)=f\left(\frac{x-y}{1-x y}\right),
$$

if $f(a)=\frac{1}{2}$, try to find the general term formula of the sequence $\left\{f\left(x_{n}\right)\right\}$.
22. (1) Since $x_{1}=a>0$, hence all $x_{n}>0$.

Also, $x_{n+1}=\frac{2}{\frac{1}{x_{n}}+x_{n}} \leqslant 1$, so, $x_{n} \in(0,1]$.
Since $x_{3}0$.

Solving, we get $x_{2}2$.
Also, $x_{2} \in(0,1]$, so $0<x_{2}<\frac{1}{2}$.
And $x_{2}=\frac{2 x_{1}}{1+x_{1}^{2}}=\frac{2 \tan \theta}{1+\tan ^{2} \theta}=\sin 2 \theta$, hence $0<\sin 2 \theta<\frac{1}{2}$.
Since $2 \theta \in(0, \pi)$, so, $0<\theta<\frac{\pi}{12}$ or $\frac{5 \pi}{12}<\theta<\frac{\pi}{2}$.
(2) Let $x=y=0$, we get $f(0)=0$.
Let $x=0$, we get $f(0)-f(y)=f(-y)$, i.e., $f(-y)=-f(y)$.
Thus, $f(x)$ is an odd function.
Notice that
$$
\begin{array}{l}
f\left(x_{n+1}\right)=f\left(\frac{2 x_{n}}{1+x_{n}^{2}}\right)=f\left(\frac{x_{n}-\left(-x_{n}\right)}{1-x_{n}\left(-x_{n}\right)}\right) \\
=f\left(x_{n}\right)-f\left(-x_{n}\right)=2 f\left(x_{n}\right),
\end{array}
$$

i.e., $\frac{f\left(x_{n+1}\right)}{f\left(x_{n}\right)}=2$,
Therefore, the sequence $\left\{f\left(x_{n}\right)\right\}$ is a geometric sequence.
Hence, $f\left(x_{n}\right)=f\left(x_{1}\right) \cdot 2^{n-1}=f(a) \cdot 2^{n-1}=2^{n-2}$.