If the square of an integer is odd, then the integer is odd The statement is: If the square of the integer x is odd, then x is odd.
My textbook says an indirect proof is applicable here but I came up with the following:


*

*State that If $x^2$ is odd, then $x$ is odd.

*Next, we assume that $x$ is odd.

*We know if $x$ is an integer, then $x = 2k+1$ given some integer $k$.

*This gives us $x^2 = 2k+1$

*$(2k+1)^2 = 2k+1$

*We know that the square of an odd integer is odd and that $2k+1$ is odd because $k$ is an integer. Therefore, QED. 


Have I overlooked something? Can this be performed with a direct proof somehow?
 A: The direct proof has to start with you assuming $x^2$ is odd, then proving $x$ must be odd. You have sort of assumed that both $x$ and $x^2$ are odd, and then shown that 'nothing bad happens' which is not a rigorous proof.
An indirect proof (via contrapositive) will probably be easier. Note that in this case, the contrapositive is
"if $x$ is not odd, then the square of $x$ is not odd"
i.e. 
"if $x$ is even, then the square of $x$ is even".
You can then use the same ideas, i.e. you can say "if $x$ is even, then $x = 2k$ for some integer $k$..."
then you have to show that, if you take $x^2$, there is some other integer $m$ so that $x^2 = 2m$.
You should try to figure out what $m$ is on your own, but if you are still stuck after some effort,

 $m = 2k^2$

A: In your step 2, you assume $x$ is odd.  But that is the very thing to be proved.  You set out to prove that if $x^2$ is odd then $x$ is odd, not that if $x$ is odd, then $x^2$ is odd.
You said $x=2k+1$, and that that gives us $x^2=2k+1$.  That is not correct.  If $x=2k+1$, then $x^2=4k^2+4k+1$.  Nor is it true that $(2k+1)^2=2k+1$, as asserted in your step 5.
A: I agree with above all in that the book's approach for indirect, i.e. here the best one being the contrapositive, as the other two options left out for the same (as per my knowledge, are the inverse and the converse), and that yields very quickly and easily too.
But, regarding the direct proof I think some effort should be made too.  WLOG, can assume that the integer is positive,
If $\exists k, k' \in \mathbb{Z+}, \,k'\mid 2,\,x^2\,=\,2k+1\,=\,(k'+1)^2$, then $x'=k'+1$.
I am not clear if the proof is rigorous enough, but it seems simple enough to raise concern.
