Prove that the square root of a positive integer is either an integer or irrational

Your proof is very good and stated well. I think it can be made shorter and tighter with a little less exposition of the obvious. However, I would prefer students to err on the side of more rather than less so I can't chide you for being thorough. But if you want a critique:

"Suppose an arbitrary number n, where n is non-negative. If $\sqrt{n}$ is an integer, then $\sqrt{n}$ must be rational. Since $\sqrt{n}$ is an integer, we can conclude that n is a square number, that is for some integer a. Therefore, if n is a square number, then $\sqrt{n}$ is rational."

Suppose now that n is not a square number, we want to show that the square root of any non-square number is irrational.

This can all be said more simply and to argue that if $\sqrt{n}$ is an integer we can conclude $\sqrt{n}$ is rational or that $n$ is therefore a perfect square, is a little heavy handed. Those are definitions and go without saying. However, it shows good insight and understanding to be aware one can assume things and all claims need justification so I can't really call this "wrong".

But it'd be enough to say. "If $n$ is a perfect square then $\sqrt{n}$ is a an integer and therefore rational, so it suffices to prove that if $n$ is not a perfect square, then $\sqrt{n}$ is irrational.

We prove by contradiction. That is, we suppose that the square root of any non-square number is rational. So $\sqrt{n}$=ab , where a,b∈Z+,b≠0. We also suppose that a≠0, otherwise ab=0, and n will be a square number, which is rational.

Terminologistically, to say "$n$ is a square number" is to mean $n$ is the square of an integer. If $n = (\frac ab)^2$ we don't usually refer to $n$ as a square (although it is "a square of a rational") We'd never call $13$ a square because $13 = (\sqrt{13})^2$.

Also you don't make the usual specification that $a$ and $b$ have no common factors. As it turns out you didn't need to but it is a standard.

Suppose b=1 . Then $\sqrt{n}$=a , which shows that n is a square number. So b≠1. Since $\sqrt{n}$>1, then a>b>1

This was redundant as $b=1 \implies$ $a/b$ is an integer and we are assuming that $n$ is not a perfect square.

.

By the unique factorization of integers theorem, every positive integer greater than 1 can be expressed as the product of its primes. Therefore, we can write a as a product of primes and for every prime number that exists in a, there will be an even number of primes in a2. Similarly, we can express b as a product of primes and for every prime number that exists in b, there will be an even number of primes in b2

Bill Dubuque in the comments noted what you meant to say was "each prime factor will be raised to any even power".

.

However, we can also express n as a product of primes. Since n is not a square number, then there exist at least one prime number that has an odd number of primes. Therefore, there exists at least one prime in the product of nb2 that has an odd number of primes. Since nb2=a2 , then this contradicts the fact that there is an even number of primes in a2 since a number can neither be even and odd.

Ditto:

Overall I think your proof is very good.

But I should point out there is a simpler one:

Assume $n = \frac {a^2}{b^2}$ where $a,b$ are positive integers with no common factors (other than 1). If $p$ is a prime factor of $b$ and $n$ is an integer, it follows that $p$ is a prime factor of $a^2$ and therefore of $a$. But that contradicts $a$ and $b$ having no common factors. So $b$ can not have any prime factors. But the only positive integer without prime factors is $1$ so $b = 1$ and $n= a^2$ so $\sqrt{n} = a$. So either for any integer either $n$ is a perfect square with an integer square root, or $n$ does not have a rational square root.

And a slight caveat: I'm assuming that your class or text is assuming that all real numbers have square roots (and therefore if there is not rational square root the square root must be irrational). It's worth pointing out, that it is a result of real analysis that speaking of a square root actually makes any sense and that we can claim every positive real number actually does have same square root value. But that's probably beyond the range of this exercise.

But if I want to be completely accurate, you (and I) have actually only proven that positive integer $n$ either has an integer square root or it has no rational square root at all. Which is the same thing as saying if positive integer $n$ has a square root, the root is either integer or irrational. But we have not actually proven that positive integer $n$ actually has any square root at all.