6.  Try to determine all positive integer pairs $(a, b)$ such that $a b^{2}+b+7$ divides $a^{2} b+a+b$.

---

The provided text has been translated into English while preserving the original formatting and line breaks.
6. Solution: If the pair of positive integers $(a, b)$ satisfies $\left(a b^{2}+b+7\right) \mid\left(a^{2} b+a+b\right)$, then $\left(a b^{2}+b+7\right) \mid\left[a\left(a b^{2}+b+7\right)-b\left(a^{2} b+a+b\right)\right] \Rightarrow\left(a b^{2}+b+7\right) \mid 7 a-b^{2}$.
(1) When $7 a-b^{2}=0$, we get $b=7 k\left(k \in \mathbf{N}_{+}\right)$, substituting gives $a=7 k^{2}$.
At this point, we have $a^{2} b+a+b=k\left(a b^{2}+b+7\right)$, so $\left(7 k^{2}, 7 k\right)$ is a solution.
(2) When $7 a-b^{2} \neq 0$, we get $b^{2}-7 a \geqslant a b^{2}+b+7$, but this is impossible.
(3) When $7 a-b^{2} \geqslant 0$, we have $7 a-b^{2} \geqslant a b^{2}+b+7$, leading to $7 a>a b^{2} \Rightarrow b=1$ or 2.
If $b=1$, then $(a+8) \mid\left(a^{2}+a+1\right)$,
and $a^{2}+a+1 \equiv(-8)^{2}+(-8)+1(\bmod (a+8))$
$$
\equiv 57(\bmod (a+8)),
$$

so $a+8=19$ or 57, thus $a=11$ or 49.
At this point, we get two more solutions $\left\{\begin{array}{l}a=11, \\ b=1 ;\end{array}\left\{\begin{array}{l}a=49, \\ b=1 .\end{array}\right.\right.$
If $b=2$, from $a b^{2}+b+7 \mid 7 a-b^{2}$ we get $4 a+9 \mid 7 a-4$.
Since $2(4 a+9)>7 a-4$, it can only be that $4 a+9=7 a-4$, but this is impossible.
Combining (1), (2), and (3), all solutions are $(11,1),(49,1),\left(7 k^{2}, 7 k\right)\left(k \in \mathbf{N}_{+}\right)$.