I am trying to prove, using the fundamental theorem of arithmetic and contradiction, that $\sqrt{2}$ is irrational. Here is my attempt.
Suppose otherwise that $\sqrt{2} \in \mathbb{Q}$, so there exists $a,b \in \mathbb{Z}$ with $b \neq 0$ such that $\sqrt{2} = \frac{a}{b}$. Without loss of generality, we can assume $a,b > 0$ since $q^2 = (-q)^2$, and that $a$ and $b$ have no common factors. Then $2 = \frac{a^2}{b^2}$, so $2b^2 = a^2$. By the fundamental theorem of arithmetic, $a$ and $b$ can be factored uniquely as a product of primes. Let $M$ be the number of prime factors, with multiplicity, of $a$ and $N$ the number of prime factors, with multiplicity, of $b$. Then $a^2$ and $b^2$ have $2M$ and $2N$ prime factors, with multiplicity. As $2$ is prime, $2b^2$ has $2N + 1$ prime factors with multiplicity, which is not even. That is, with multiplicity, $a^2$ has an even number of prime factors and $2b^2$ has an odd number of prime factors, contradicting the fundamental theorem of arithmetic.
How does this proof look?