False Proof that $\sqrt{4}$ is Irrational Everyone with any basic knowledge of number theory knows the classic proof of the irrationality of $\sqrt{2}$. Curious about generalizations using elementary methods,  I looked up the irrationality of $\sqrt{3}$, and found the following:

Say $ \sqrt{3} $ is rational. Then $\sqrt{3}$ can be represented as $\frac{a}{b}$, where a and b have no common factors.
So $3 = \frac{a^2}{b^2}$ and $3b^2 = a^2$. Now $a^2$ must be divisible by $3$, but then so must $a $ (fundamental theorem of arithmetic). So we have $3b^2 = (3k)^2$ and $3b^2 = 9k^2$ or even $b^2 = 3k^2 $ and now we have a contradiction.

Such a proof follows the same basic logic as the proof for $\sqrt{2}$, except for using the fundamental theorem of arithmetic to replace and generalize the trivial fact that $n$ is even if $n^2$ is even.  However,  when I apply this proof format to $\sqrt{4} $ (which is clearly an integer and thus rational)  I get the following:
Say $ \sqrt{4} $ is rational. Then $\sqrt{4}$ can be represented as $\frac{a}{b}$, where a and b have no common factors.
So $4 = \frac{a^2}{b^2}$ and $4b^2 = a^2$. Now $a^2$ must be divisible by $4$, but then so must $a $ (fundamental theorem of arithmetic). So we have $4b^2 = (4k)^2$ and $4b^2 = 16k^2$ or even $b^2 = 4k^2 $, which implies that $b=4n$ by the fundamental theorem. Now we have a contradiction (since can note that both $a$ and $b$ are divisible by $4$ and we assumed they were coprime)
This proof is clearly false,  yet I fail to see where it differs. Where does it do so?
Just because $a^2$ is divisible by $4$, that doesn't mean $a$ is.
Now If you want to prove that square root of a non perfect square is irrational.

Then you can do this what I wrote below as a proof.

Let $p$ is a non perfect square. We are required to prove $\sqrt{p}$ is irrational. Let $\sqrt{p}$

is rational and of the form $\frac{a}{b}$ where $a\;\;and\;\;b$ are coprime and $b\neq{0}$.
Now, we have

$$\sqrt{p}=\frac{a}{b}$$
By squaring both sides we have
$$p=\frac{a^2}{b^2}$$
$$\implies{a^2}=p{b^2}$$
We know that $a\;and\;b$ are coprime to each other and $g.c.d(a,b)=1$.
So we have $$ax+by=1$$ for some non zero integers $x$ and $y$.Then multiply $\sqrt{p}$ on both sides.Then we get
$$\sqrt{p}ax+\sqrt{p}by=\sqrt{p}$$See that $a=\sqrt{p}b$. So we have 
$$pbx+ay=\sqrt{p}$$
Now see that the L.H.S belongs to integer set whereas the R.H.S belongs to
$\mathbb{R}\backslash \mathbb{Z}$.

Hence it is a contradiction.So $\sqrt{p}$ is irrational. May be it will help you.