Is $\sqrt{m}$ irrational iff at least one prime occurs with an odd exponent in the factorisation of $m$? Thinking about it, I think I found the following criterion for irrationality of $\sqrt{m}$ if $m$ is a positive integer.

Let $p_1^{a_1}\cdots p_k^{a_k}$ be the prime factorization of $m$. Then $\sqrt{m}$ is irrational if and only if $a_i$ is odd for at least one $1\le i\le k$.

Anyone knows if this is correct and, if so, a proof thereof?

Yes this is true. A nice way to think about this, is that if you extend the notion of prime factorisation to allow for negative exponents, you can show that all rational numbers have a unique prime factorisation as well. Then if you square a rational number of the form $r=p_1^{a_1}\cdots p_k^{a_k}$, where $a_i\in\mathbb{Z}$, then the square of this has the unique prime factorisation
$$r^2=p_1^{2a_1}\cdots p_k^{2a_k}$$
So the square of any rational number has only even exponents in its prime factorisation. The converse is pretty obvious.
Note that from this line of thinking its easy to see that if $m$ is an integer, then $\sqrt{m}$ is either irrational or an integer too.
