Example 5 Given the sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=\frac{1}{2}, a_{1}+a_{2}+\cdots+a_{n}=n^{2} a_{n}, n \geqslant 1$. Find the general term formula for $a_{n}$.
(1975 Canadian Olympiad Problem)
When $n \geqslant 2$, since
$$
a_{1}+a_{2}+\cdots+a_{n}=n^{2} \cdot a_{n}, a_{1}+a_{2}+\cdots+a_{n-1}=(n-1)^{2} \cdot a_{n-1} \text {, }
$$

Therefore, $a_{n}=n^{2} a_{n}-(n-1)^{2} a_{n-1}$,
Thus, we get $a_{n}=\frac{n-1}{n+1} a_{n-1}, n=2,3, \cdots$
Hence, we have $\quad a_{n}=\frac{1}{n(n+1)}, n=1,2,3, \cdots$