Proof verification: Prove $\sqrt{n}$ is irrational. Problem
Let $n$ be a positive integer and not a perfect square. Prove that $\sqrt{n}$ is irrational.
Proof
Consider proving by contradiction. If $\sqrt{n}$ is rational, then there exist two coprime integers $p,q$ such that $$\sqrt{n}=\frac{p}{q},$$ which implies $$p^2=nq^2.$$
Moreover, since $p, q$ are coprime, by Bézout's theorem, there exist two integers $a,b$ such that $$ap+bq=1.$$
Thus
$$p=ap^2+bpq=anq^2+bpq=(anq+bp)q,$$ which implies $$\sqrt{n}=\frac{p}{q}=anq+bp \in \mathbb{N^+},$$ which contradicts.

Proof by contradiction is not needed. It suffices to "take the contrapositive". This is when you switch the antecedent and the conclusion of an implication and negate them. Formally, it looks like this:
$$ P \implies Q \text{ has the contrapositive } \neg Q \implies \neg P$$
It applies to the proof in the following way. Your argument shows that if $\sqrt{n}$ is rational, then it must be an integer. But if $\sqrt{n}$ is an integer, then $n$ must be a perfect square. 
This means that if $n$ is not a perfect square, then $\sqrt{n}$ is not an integer, so $\sqrt{n}$ is not rational. Q.E.D.
