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.
Well, this is not correct, there are 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
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 confuse you more.