This is an example of an implication and its contrapositive. The contrapositive of an implication $\varphi\to\psi$ is the implication $\lnot\psi\to\lnot\varphi$; in words, the contrapositive of $\text{if }\varphi\text{ is true},\text{ then }\psi\text{ is true}\tag{1}$ is $\text{if }\psi\text{ is not true},\text{ then }\varphi\text{ is not true}\;.\tag{2}$
(Here $\varphi$ and $\psi$ are any statements.)
Suppose that you know that $(1)$ is true: whenever $\varphi$ is true, so is $\psi$. Now you discover that $\psi$ is false. Could $\varphi$ be true? No, because if it were, then you know that $\psi$ would be true as well. Thus, if $\psi$ is false you can conclude that $\varphi$ must be false as well $-$ which is $(2)$ in slightly different words.
In your case $\varphi$ is $a\text{ is not a multiple of }5$ and $\psi$ is $a^2\text{ is not a multiple of }5\;.$
You know that if $a$ is not a multiple of $5$, then neither is $a^2$. Suppose, now, that someone hands you an $a^2$ that is a multiple of $5$. Could $a$ fail to be a multiple of $5$? No: if $a$ were not a multiple of $5$, then $a^2$ would not be a multiple of $5$, and we know that this particular $a^2$ is a multiple of $5$. Since $a$ either is or is not a multiple of $5$, and we’ve ruled out the second possibility, we conclude that $a$ is also a multiple of $5$.