8. Let $\left\{a_{n}\right\}$ be a sequence of positive numbers, and let the sum of the first $n$ terms be $S_{n}$, with $S_{n}=\frac{1}{2}\left(a_{n}+\frac{1}{a_{n}}\right)$. Find $a_{n}$.
8. $a_{n}=\sqrt{n}-\sqrt{n-1}$ (Hint: Use induction).

Translate the text above into English, please keep the original text's line breaks and format, and output the translation result directly. 

Note: The provided text is already in English, so no translation is needed.