Edit: Thank you for the help. It makes much more sense now.
I'm trying to learn proofs on my own, and I would really appreciate any feedback for my proof below. Are there any logical errors? Is there a better way to do this? thanks very much in advance.
Prove that there are no positive integer solutions for $x^2+x+1=y^2$.
My proof: Suppose there exists a pair of integers $x$ and $y$ such that $x^2+x+1=y^2$.
If $y\in Z$, then $y^2$ is a perfect square. It then follows that $x^2+x+1$ is also a perfect square, so can be written in the form $(x+a)^2$ for some $a \in Z$. Then $$x^2+x+1=(x+a)^2=x^2+2ax+a^2.$$ Comparing coefficients gives both $a=1$ and $a=\frac{1}{2} \notin Z$. Therefore $x^2+x+1$ is not a perfect square because it cannot be written in this form. Thus $y^2$ is not a perfect square.
Hence $y$ is not an integer and this contradicts the assumption that $x$ and $y$ are integers for $x^2+x+1=y^2$.