TITLE: Proving $n^2=n$, $n$ is even and $n$ is greater than $0$ is false
QUESTION [6 upvotes]: I am wondering if I have made a wrong jump in logic with my answering to this question.
The original statement goes "There exists an integer $n$ such that $n^2=n$, $n$ is even and $n$ is greater than $0$".
I have taken the approach of first defining that if $n$ is even, than $n=2k$ where $k$ is of the set of integers.
I have then substituted this into $n^2=n$ by saying that $(2k)^2=(2k)$, and as such $2k=1$. Given this I have concluded it to be false as there is no integer $k$ such that $2k=1$.
I am worried about this logic though because if $n$ is equal to $0$ (which is an even number that fits the definition of $2k$) then $n^2=n$ is true which seems to go against my previous logic (which is where the final comparison to $n$ having to be greater than $0$ would come in).
Am I right in being worried about the direction I have taken this logic? If so where have I gone wrong in my line of thinking? Thank you for all help.

REPLY [3 votes]: We have $n^2=n$ implies $n^2-n=0$, i.e., $$n(n-1)=0.$$ Thus either $n=0$ or $n=1$, but, by hypothesis, both these options are impossible. (They are the only possible solutions by inspection and the fundamental theorem of  algebra; moreover, by the quadratic formula,
$$\begin{align}
n&=\frac{-(-1)\pm\sqrt{(-1)^2-4(1)(0)}}{2(1)}\\
&=\frac{1\pm 1}{2}\\
&=0\text{ or }1.)
\end{align}$$