Let n $\in$ $\mathbb{N}$. Prove that neither n(n+1) nor n(n+2) is a perfect square.
I tried a proof by contradiction and I just want to make sure that I didn't violate anything. I wrote:
Assume n $\in$ $\mathbb{Z}$, and for the sake of contradiction, assume that n(n+1) and n(n+2) are perfect squares.
Thus n(n+1)=a$^2$ and n(n+2)=b$^2$. for arbitrary integers a and b.
n(n+1)=n$^2$+n=a$^2$ and n(n+2)=n$^2$+2n=b$^2$.
Subtracting b$^2$ from a$^2$ we get: -n=a$^2$-b$^2$.
Thus we can see that n=-(a+b)(a-b).
consider three cases: one where a>b, b>a and a=b.
Case I: a > b.
a>b$\implies$ n is negative, since (a+b) will be positive, and (a-b) will be positive, thus the sum of two positives and a negative is negative. this is a contradiction to our assumption that n $\in$ $\mathbb{N}$
thus Case I isn't satisfied.
Case II: b > a
b > a $\implies$ n is positive, since (a+b) will be positive, and (a-b) will be negative, thus the product of two negatives and a positive gives us a positive. thus case 2 is satisfied
Case III: a=b
a=b $\implies$ n is zero, since (a+b) will be positive, and (a-b) will be zero, thus the product will be zero. this is also a contradiction to our assumption that n $\in$ $\mathbb{N}$ thus Case III isn't satisfied.
Therefore, since two of the cases yields in a contradiction, then our assumption that both n(n+1) and n(n+2) is a perfect square is false. Thus this proves that neither n(n+1) nor n(n+2) is a perfect square.
Your proof is not valid.
Note that the negation of neither $n(n+1)$ nor $n(n+2)$ is a perfect square is at least one of $n(n+1)$ or $n(n+2)$ is a perfect square.
You have assumed both $n(n+1)$ and $n(n+2)$ are perfect square to get to a contradiction.