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.
 A: It is fine.
I would perhaps just note that the equality $p=(anq+bp)q$ goes against the hypothesis that $p$ and $q$ are coprime, unless $q=1$, in which case $\sqrt n=p\in\mathbb Z$. But that is just a matter of taste.
A: At this level, one should be more explicit about how the contradiction is obtained, i.e. the final equation contradicts the hypothesis that $n$ is a perfect square. That done the proof is correct.
The proof essentially repeats inline the below Bezout-based proof of Euclid's Lemma (for $\,k = p)$. Generally it is better to invoke the Lemma by name (Euclid's Lemma) rather than repeat its proof inline, i.e. in your proof you could write $\,\gcd(\color{#0a0}{q,p})=1,\ \color{#0a0}{q\mid p}\cdot\color{#c00}p \,\Rightarrow\, q\mid\color{#c00} p\,$ by Euclid's Lemma.
Euclid's Lemma $\ \gcd(p,q) = 1,\,\ q\mid p k\,\Rightarrow\, q\mid k$
Proof $\,\ q\mid pk,qk\, \Rightarrow\, q\mid (ap\!+\!bq)k = k,\,$ where $\,ap\!+\!bq = 1\,$ by Bezout.
Remark $ $ See here for a simple Bezout based proof that generalizes to higher-degree roots and arbitrary algebraic integers {i.e. monic case [lead coeff $=1]$ of Rational Root Test). It uses Bezout to reduce the degree of the monic polynomial of which the number is a root, so we eventually reach a linear monic $\,x - n,\,$ so $\,x = n\,$ is an integer.
A: 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.
