Example 2 Find all integers $m, n$ such that
$$
m n \mid \left(3^{m}+1\right), m n \mid \left(3^{n}+1\right) \text {. }
$$
(2005, Korean Mathematical Olympiad)
Solve by discussing two cases.

(1) One of $m$ and $n$ is 1.

Without loss of generality, let $m=1$. Then $mn=n, 3^{m}+1=4$.
Thus, $n \mid 4 \Rightarrow n=1,2$ or 4.
Upon verification, we find that $(m, n)=(1,1),(1,2)$ satisfy the given conditions.
Symmetrically, the solutions to the equation in this case are
$$
(m, n)=(1,1),(1,2),(2,1) \text {. }
$$
(2) $m \geqslant 2, n \geqslant 2$.

If $m$ and $n$ are both even, then $4 \mid \left(3^{m}+1\right)$.
But $3^{m}+1 \equiv(-1)^{m}+1 \equiv 2(\bmod 4)$, so $4 \nmid \left(3^{m}+1\right)$.
This is a contradiction.
Therefore, at least one of $m$ and $n$ must be odd. Without loss of generality, assume $m$ is odd.
Let $p$ be the smallest prime factor of $m$.
Note that $3 \nmid \left(3^{m}+1\right)$. So, $p \geqslant 5$.
Since $mn \mid \left(3^{m}+1\right) \Rightarrow p \mid \left(3^{m}+1\right)$
$$
\Rightarrow 3^{m} \equiv-1(\bmod p) \Rightarrow 3^{2 m} \equiv 1(\bmod p) \text {. }
$$

Also, by Fermat's Little Theorem,
$$
3^{p-1} \equiv 1(\bmod p) \text {. }
$$

Let the order of 3 modulo $p$ be $\lambda$. Then
$$
3^{\lambda} \equiv 1(\bmod p), \lambda \mid 2m, \lambda \mid (p-1), \lambda \nmid m .
$$

Note that $p$ is the smallest prime factor of $m$.
So, $(m, p-1)=1$.
Thus, $(2m, p-1)=2$.
Therefore, $\lambda \mid 2 \Rightarrow \lambda=2$.
Hence, $3^{2} \equiv 1(\bmod p) \Rightarrow p \mid 8$, which contradicts $p \geqslant 5$ being a prime.
In conclusion, the solutions that satisfy the conditions are
$$
(m, n)=(1,1),(1,2),(2,1) .
$$