Suppose that there exist positive integers $k, m, n$ and a prime number $p$ such that $$p^{2k+1}m(mn+1)^2+m^2$$ is a square number. Prove that $m$ is also a square number.
If $m$ is not divided by $p$, then $gcd\ (m, p^{2k+1}(mn+1)^2+m)=1$, hence $m$ is an integer.
If $p|m$, then there exist positive integers $a$ and $b$ such that $m=p^a \times b$ and $gcd(p,b)=1$. Then $$p^{2k+1}m(mn+1)^2+m^2 = p^{2k+a+1}b(p^a bn+1)^2+p^{2a}b^2$$ Since $gcd\ (b, p^{2k+a+1}(p^a bn+1)^2+p^{2a}b)=1$, then $b$ is a square number and $p^{2k+a+1}(p^a bn+1)^2+p^{2a}b$ is also a square number. Let $b=c^2$
Here I am stuck. How can I progress ?