Square root of prime is irrational. Is this a valid proof? I know similar questions exist, but I want to know, if this is a valid proof.
A prime number has 1 and it self as divisors. So the subset of a prime number is $ D(p) = \{1, p\}$
Now I want to prove $\sqrt{p} = \frac{a}{b}$  , to get the opposite.
Also $gcd(a,b)=1$.
Let's square it.
$p = \frac{a^2}{b^2}$
And divide by $b^2$
$\frac{p}{b^2} = \frac{a^2}{b^4}$
In this case ${b^2}$ is also a divisor of  $p$, which doesn't fit the definition of prime numbers. So the square root of a prime number must be irrational.
 A: Well, this is not correct, there is some issues. 
Suppose you have $a$ and $b$, two integers. We say that $b$ is a divisor of $a$ if there is some integer $x$ such that $a = bx$. Now, according to this definition, a prime number $p$ is a positive integer that has exactly two positive divisors, namely, $1$ and $p$.
So, in your proof, when you say 

$$\frac{p}{b^2} = \frac{a^2}{b^4} \,.$$ In this case $b^2$ is a divisor of $p$ which doesn't fit the definition of prime number.

this is false. To say that $b^2$ is a divisor of $p$, there must be some integer $x$ such that $p = b^2x$, and this is not the case, since we cannot factor $b^2$ of $a^2/b^2$ to get another integer. 
You see? I hope this doesn't confuses more.
A: Assume $ p$ is a prime $\ge 2$ and
$$\sqrt{p}=\frac ab$$
with
$0<b<a$ and $gcd(a,b)=1$.
then
$$a^2=pb^2$$
$$\implies a|pb^2$$
and by Gauss,
$$a|p$$
thus
$$a=1 \text{ or } a=p$$
$ a$ cannot be equal to $1$ because
$0<b<a$.
If $ a= p$ then $p^2=pb^2$ gives $p=b^2$
this is in contradiction with the fact that $ p $ is prime.
A: As mentioned, how do you know $\frac{a^2}{b^4} \in \mathbb{Z}$? Here are two ideas once you get $p = \frac{a^2}{b^2}$. Consider that $b|a$ even though you wrote $\frac{a}{b}$ in lowest terms. Or, consider the parity of the amount of primes on each side of the equation
$$b^2p=a^2$$
Either will help you prove what you want. 
A: We have that $\sqrt{p}=\dfrac{a}{b}$ with $a$ and $b$ being relatively prime integers. Thus, $p=\dfrac{a^2}{b^2}$ and so $a^2=p\cdot b^2$.
$a^2$ must be divisible by $p$ because $p, a^2,$ and $b^2$ are all integers and so $a$ must be divisible by $p$ as well. If we define $a=pc$ where $c$ is also an integer, then $p=\dfrac{p^2\cdot c^2}{b^2} \rightarrow 1 = \dfrac{p\cdot c^2}{b^2} \rightarrow b^2 = p \cdot c^2$.
$b^2$ must also be divisible by $p$ because $p, b^2,$ and $c^2$ are all integers and so $b$ must be divisible by $p$ as well. However, $a$ and $b$ were defined to be relatively prime and yet they have a common factor of $p$, which means that they are not relatively prime.
Thus, the claim that $\sqrt{p}$ can be written as the division of two relatively prime integers $a$ and $b$ is contradicted as $a$ and $b$ cannot be relatively prime.
