7. Let $a_{1}=1, a_{n+1}=\frac{1-n}{n+1} a_{n}+\frac{(-1)^{n-1}}{n(n+1)}$. Then for any positive integer $n, a_{n}=$
7. $\left\{\begin{array}{ll}1, & n=1 ; \\ \frac{(-1)^{n}}{n}, & n>1\end{array}\right.$

Notice that
$$
\frac{(-1)^{n-1}}{n(n+1)}=(-1)^{n-1}\left(\frac{1}{n}-\frac{1}{n+1}\right) \text {. }
$$

Thus, rearranging terms we get
$$
\begin{array}{l}
a_{n+1}+\frac{(-1)^{n}}{n}=\frac{1-n}{n+1} a_{n}-\frac{(-1)^{n-1}}{n+1} \\
=-\frac{n-1}{n+1}\left[a_{n}+\frac{(-1)^{n-1}}{n-1}\right](n>1) . \\
\text { Hence } \prod_{k=2}^{n-1}\left[a_{k+1}+\frac{(-1)^{k}}{k}\right] \\
=\prod_{k=2}^{n-1}\left\{-\frac{k-1}{k+1}\left[a_{k}+\frac{(-1)^{k-1}}{k-1}\right]\right\}(n>2) .
\end{array}
$$

Then $a_{n}+\frac{(-1)^{n-1}}{n-1}$
$$
\begin{array}{l}
=(-1)^{n-2} \frac{2}{n(n-1)}\left[a_{2}+\frac{(-1)^{2-1}}{2-1}\right] \\
=\frac{(-1)^{n-2}}{n(n-1)}\left(2 a_{2}-2\right)=\frac{(-1)^{n-1}}{n(n-1)} .
\end{array}
$$

Thus $a_{n}=\frac{(-1)^{n-1}}{n(n-1)}-\frac{(-1)^{n-1}}{n-1}=\frac{(-1)^{n}}{n}(n>2)$.
Moreover, $a_{2}=\frac{1}{2}$ satisfies this formula.