7. Find all $m, n \in \mathbf{N}^{*}$, such that the polynomial $f(x)=1+x^{n}+x^{2 n}+\cdots+x^{m n}$ can be divided by $g(x)=1+x+x^{2}+\cdots+x^{m}$.
7. From $x^{m+1}-1=(x-1) g(x)$, we get $g(x)=\left(x-\varepsilon_{1}\right)\left(x-\varepsilon_{2}\right) \cdots\left(x-\varepsilon_{m}\right)$, where $\varepsilon_{k}=\cos \frac{2 k \pi}{m+1}+ i \sin \frac{2 k \pi}{m+1}(1 \leqslant k \leqslant m)$. Clearly, when $k \neq j$, $\varepsilon_{k} \neq \varepsilon_{j}$. Therefore, the necessary and sufficient condition for $g(x) \mid f(x)$ is $f\left(\varepsilon_{k}\right)=0, k=1$, $2, \cdots, m$. Given $f(x)=\frac{x^{n(m+1)}-1}{x^{n}-1}$, we know that the necessary and sufficient condition for $g(x) \mid f(x)$ is $\varepsilon_{k}^{n(m+1)}-1=0$ and $\varepsilon_{k}^{n} \neq 1$.

Since $\varepsilon_{k}^{n(m+1)}-1=0$ holds for any $n \in \mathbf{N}^{*}$, the necessary and sufficient condition for $g(x) \mid f(x)$ is $\varepsilon_{k}^{n}=\cos \frac{2 k n \pi}{m+1}+ i \sin \frac{2 k n \pi}{m+1} \neq 1$, where $k=1,2, \cdots, m$. Thus, it is necessary and sufficient that $n$ and $m+1$ are coprime.

In summary, all pairs of positive integers $(m, n)$ that satisfy $g(x) \mid f(x)$ are $\left\{(m, n) \mid m \in \mathbf{N}^{*}, n \in \mathbf{N}^{*}, n \text{ and } m+1 \text{ are coprime}\right\}$.