(12 分) 已知虚数 $z=a+b \mathrm{i}(a, b \in \mathbf{R}, b \neq 0)$ 满足 $z+\frac{2}{z} \in \mathbf{R}$.

(1) 求 $|z|$;

(2) 若 $a\left(z-\frac{2}{z}\right)=\mathrm{i}$, 求 $\frac{1}{a}+\frac{1}{b}$ 的值.
(1) 依题意 $z+rac{2}{z}=a+b \mathrm{i}+rac{2}{a+b \mathrm{i}}=a+b \mathrm{i}+rac{2(a-b \mathrm{i})}{(a+b \mathrm{i})(a-b \mathrm{i})}$,$=a+b \mathrm{i}+rac{2 a-2 b \mathrm{i}}{a^{2}+b^{2}}=a+rac{2 a}{a^{2}+b^{2}}+\left(b-rac{2 b}{a^{2}+b^{2}}
ight) \mathrm{i} \in \mathbf{R}$, 所以 $b-rac{2 b}{a^{2}+b^{2}}=0 \Rightarrow a^{2}+b^{2}=2$, 所以 $|z|=\sqrt{2}$.(2) 依题意 $a\left(z-rac{2}{z}
ight)=i$,即 $a\left(a+b \mathrm{i}-rac{2}{a+b \mathrm{i}}
ight)=a\left[a+b \mathrm{i}-rac{2(a-b \mathrm{i})}{(a+b \mathrm{i})(a-b \mathrm{i})}
ight]$$=a\left[a+b \mathrm{i}-rac{2 a-2 b \mathrm{i}}{a^{2}+b^{2}}
ight]=a\left[a-rac{2 a}{a^{2}+b^{2}}+\left(b+rac{2 b}{a^{2}+b^{2}}
ight) \mathrm{i}
ight]$$=a^{2}-rac{2 a^{2}}{a^{2}+b^{2}}+\left(a b+rac{2 a b}{a^{2}+b^{2}}
ight) \mathrm{i}=a^{2}-a^{2}+(a b+a b) \mathrm{i}=2 a b \mathrm{i}=\mathrm{i}$,所以 $2 a b=1, a b=rac{1}{2}$.由 $\left\{egin{array}{l}a^{2}+b^{2}=2 \ a b=rac{1}{2}\end{array}
ight.$ ，得 $(a+b)^{2}=a^{2}+2 a b+b^{2}=2+1=3$,所以 $a+b= \pm \sqrt{3}$, 所以$$rac{1}{a}+rac{1}{b}=rac{a+b}{a b}=rac{ \pm \sqrt{3}}{rac{1}{2}}= \pm 2 \sqrt{3}$$