I'm looking for a set of conditions and maybe a proof of said conditions for the thought proposed in the title. It seems to me that what was stated in the title always is true when N is not a perfect square and N < m, but I can find instances that work for perfect squares N, e.g. m = 12, N = 4.
If it's not clear what I'm asking, I'm looking for a general case of what's asked in this question.
Any help is appreciated! Thanks.
Edit: m and N are positive integers.
(I assume $m$ integer and $N$ non-zero integer.)
The proposed statement is true for all $m\in\mathbb{Z}$ if and only if $N$ is square-free (this is obvious). If $N=k^2l$ with $l$ square-free and $k\neq\pm1$ then $m=kl$ is a counterexample.
More precisely: We have that $N\mid m^2\implies N\mid m$ for all $m\in\mathbb{Z}$ if and only if $N$ is a square-free integer.
Example for $N$ not a perfect square: $N=12$, $m=6$.
If you wanted $m>N$: $N=12$, $m=18$.
A general statement is not really interesting: We have that $N\mid m^2\implies N\mid m$ if and only if $N\mid m$ or $N\nmid m^2$. This is not quite useful, is it?