I was doing a problem where I had to prove that $\sqrt5$ was irrational, and I went through with the usual method. Then, I was curious what would've happened if I tried to do this with a value whose square root was rational, such as $\sqrt4$.
Let's assume that we do not know that $\sqrt4$ is rational or not.
Let's assume $\sqrt4$ is rational.
$\sqrt4 = p/q$
$4 = p^2/q^2$
$4q^2 = p^2$
This means that 4 is a factor of p.
Let's assume p = 4x
This means that:
$4q^2 = 16x^2$
$q^2 = 4x^2$
This means q is also a factor of 4. But, here we are making the assumption that p and q are co-prime, so this contradiction occurs when we assume that $\sqrt4$ is rational, and hence $\sqrt4$ is irrational.
The contradiction method seems to suggest that $\sqrt4$ is irrational, even though we know that it equals 2 which is rational. Did I make a mistake somewhere? Or is the perhaps a problem in the contradiction method?
$4q^2=p^2$ means $4$ is a factor of $p^2$. That does not mean $4$ is a factor of $p$, since $4$ is not prime (it might be, it might not be). Assuming $p,q$ are coprime, you can only guarantee $2$ is a factor of $p$. If $p=2x$, then $4q^2=4x^2\implies x=q$ ($p,q$ can obviously be taken positive) so that $p/q=2$.
You conclude that, if $p/q$ is a coprime rational representation of $\sqrt{4}$, then $p/q=2$. That's ok, because $\sqrt{4}$ is indeed equal to $2$.