The next to last digit of the square of a natural number is odd. Prove that its last digit is $6$ . The next to last digit of the square of a natural number is odd. Prove that its last digit is $6$ .
The solution given in the book is as follows:

The last two digits of the square $n$ depends only on the last two digits of $n$ itself. Suppose n has last two digits $a$ and $b$and we have $(10a+b)^2=100a^2+20ab+b^2$ . It is clear that the tens digit of the number $b^2$ must be odd. A case-by-case analysis shows that the units digit must then be equal to $6$.

Well, I didn't get how do they draw the conclusion that "It is clear that the tens digit of the number $b^2$ must be odd. A case-by-case analysis shows that the units digit must then be equal to $6$." I am not quite getting it?
 A: The hypothesis in the problem states that the tens digit of the number must be odd. Let's look at the contribution by each term:

*

*$100a^2$ is a multiple of $100$ and thus contributes $0$ to the tens digit.

*$20ab$ is a multiple of $20$ and thus contributes some even number to the tens digit.

*This means that in order for the tens digit to be odd, the tens digit of $b^2$ must be odd.

With that established, we look at the perfect squares from $0^2$ to $9^2$, namely $0,1,4,9,16,25,36,49,64,81$. The only ones with odd tens digit are $4^2=16$ and $6^2=36$, so either $b=4$ or $b=6$. Noting that $100a^2$ and $20ab$ contribute nothing to the units digit, we know that the units digit of $(10a+b)^2$ is equal to the units digit of $b^2$, which is $6$ for all possible values of $b$.
A: Perfect squares are $\equiv 0,1 \bmod 4$; however, that does not mean that all numbers $\equiv 0,1 \bmod 4$ are squares. A number $N$ of the form $$N=100a+10(2k+1) +b \equiv 2+b \bmod 4$$ where $a$ is any positive integer and $(2k+1),b$ are single digits.
In order for $2+b \equiv 0,1 \bmod 4$, it must be the case that $b\equiv 2,3 \bmod 4$. That means $b\in \{2,3,6,7\}$. Of those digits, only $6$ can be the last digit of a perfect square.
So an odd (i.e. $2k+1$) tens place digit requires the units digit to be $6$ in order for the number to be a perfect square. Further note that a number ending in $6$ is not necessarily a square, even if the tens digit is odd.
