4.  Try to determine all positive integer pairs $(a, b)$ such that $a b^{2}+b+7$ divides $a^{2} b+a+b$.
4. $b\left(a^{2} b+a+b\right)-a\left(a b^{2}+b+7\right)=b^{2}-7 a$. Therefore, $a b^{2}+b+7 \mid\left(b^{2}-7 a\right)$
(i) If $b^{2}-7 a>0$, then: $a b^{2}+b+7 \leqslant b^{2}-7 a<b^{2}$. Contradiction;
(ii) If $b^{2}-7 a<0$, then $a b^{2}+b+7 \leqslant 7 a-b^{2}<7 a$. So $b^{2}<7$, hence $b=1$ or $b=2$.

When $b=1$, the given condition becomes $a+8$ divides $a^{2}+a+1$, so $a^{2}+a+1=(a+8)(a-7)+57$, which gives $a+8 \mid 57 =3 \times 19$, so $a=11$ or $a=49$.
When $b=2$, $4 a+9 \mid 4-7 a$ and since $0<7 a-4<2(4 a+9)$, we have: $4 a+9=7 a-4$ which has no integer solution;
(iii) If $b^{2}-7 a=0$ then $b=7 k, a=7 k^{2}$, where $k \in \mathbf{N}^{*}$. In this case, $a^{2} b+a+b$ divided by $a b^{2}+b+7$ has a quotient of $k$, and the given condition is satisfied.
In summary: All positive integer pairs that satisfy the condition are $(a, b)=(11,1),(49,1),\left(7 k^{2}, 7 k\right)\left(k \in \mathbf{N}^{*}\right)$.