<s>[INST] Knowing that $m$ and $n$ are positive integers satisfying $mn \mid m^2 + n^2 + m$, prove that $m$ is a square number. 
Knowing that $m$ and $n$ are positive integers satisfying $$\large mn \mid m^2 + n^2 + m$$, prove that $m$ is a square number.

We have that $mn \mid m^2 + n^2 + m \implies mn \mid (m^2 + n^2 + m)(n + 1)$
$\implies mn \mid m^2n + n^3 + mn + m^2 + n^2 + m$ $\implies \left\{ \begin{align} &mn \mid n^3\\ &mn \mid n^3 + m^2 + n^2 + n \end{align} \right.$
$\implies \left\{ \begin{align} m &\mid n^2\\ mn &\mid m(m + 1) + n^2(n + 1) \end{align} \right.$ $\implies \left\{ \begin{align} mm' &= n^2\\ mn &\mid m(m + 1) + mm'(n + 1) \end{align} \right. (m \in \mathbb Z^+)$
$\implies \left\{ \begin{align} mm' &= n^2\\ m'n &\mid m'(m + 1) + m'^2(n + 1) \end{align} \right.$ $\implies \left\{ \begin{align} mm' &= n^2\\ m'n &\mid n^2 + m' + m'^2 \end{align} \right.$
That also means that if the $m$ is proven to be a square number, $m'$ is also a perfect square. Moreover, $mm' = n^2 \implies (m, m') = 1$ needs to be proven. But I don't know how to.
 [/INST] Let $p$ be prime and let $k\ge0 $ be maximal with $p^k\mid m$. Similarly, let $l\ge 0$ be maximal with $p^l\mid n$. So $m=p^kr$, $n=p^ls$ for some positive  integers $r,s$.
So $$p^{k+l}rs\mid p^{2k}r^2+p^{2l}s^2+p^kr. $$
Conclude that $2l\ge k$ and
$$p^{l}rs\mid p^{k}r^2+p^{2l-k}s^2+r. $$
of $k>0$ then also $l>0$ and so $p\mid p^{2l-k}s+r$, which leads to $2l-k=0$. Therefore $k$ must be even.
As this holds for all primes $p$, we conclude that $m$ is a perfect square.
</s>