Let $n=2^e m$ where $m$ is odd. Note that $\sigma(2^e)$ is odd. So by the multiplicativity of $\sigma$, $\sigma(n)$ is odd iff $\sigma(m)$ is odd. Any power of $2$ is a square or twice a square. So we need only show that if $\sigma(m)$ is odd for the odd number $m$, then $m$ is a perfect square.
If $m$ is not a perfect square, there is a prime $p$, necessarily odd, such that the highest power of $p$ that divides $m$ is $p^t$, where $t$ is odd.
But by multiplicativity, $1+p+\cdots+p^t$ divides $\sigma(m)$. And $1+p+\cdots+p^t$ is even, since it is the sum of an even number of odd numbers. This contradicts the fact that $\sigma(m)$ is odd.
Remark: The converse is straightforward: If $n$ has shape $w^2$ or $2w^2$, then $\sigma(n)$ is odd.