Let's rewrite the sum \(\sum_{d\mid n}\mu(d)=0\) by trying to omit the ones that are zero anyway. If we do this, the sum reduces to the long, but correct, \begin{equation*}\sum_{d\mid n}\mu(d)=\sum_{\substack{\text{all divisors }d\text{ with just one or zero}\\\text{ of each prime factor }p_{i}\text{ of }n}}(-1)^{\text{the number of primes dividing } d}\, .\end{equation*} Now let's set up a little notation. First, let \(k\) be the total number of (distinct) prime divisors of \(n\). Next, let's borrow from Definition 23.3.3 the notation \(\omega(d)\) for the number of distinct prime divisors of a divisor \(d\) of \(n\).
Then the crazy sum \(\sum_{d\mid n}\mu(d)\) becomes easier to write: \begin{equation*}\sum_{\substack{\text{all divisors }d\text{ with just one or zero}\\\text{ of each prime factor }p_{i}\text{ of }n}}(-1)^{\omega(d)}=\sum_{d\text{ that work}}(1)^{k-\omega(d)}(-1)^{\omega(d)}\end{equation*} You should be asking yourself why I bothered introducing \(k\). You may want to think about that briefly, noting that \((k-\omega(d))+\omega(d)=k\).
The rationale is that we can think of each of the divisors \(d\) that have no square factors (the ones in question) as having \(\omega(d)\) of the prime factors of \(n\) picked, and the other \(k-\omega(d)\) factors omitted. So, in some sense, for each \(d\) we are really picking a subset of the primes dividing \(n\), of size \(\omega(d)\), and then multiplying by \(1\) for each prime picked and \(-1\) for each one not picked.
But if instead we consider just picking a subset of \(\{1,2,\ldots,k\}\) and assigning \(\pm 1\), that would be the same thing, with the difference that we know this is the same as the result of expanding \begin{equation*}(1+(-1))^{k}=(1+(-1))(1+(-1))\cdots(1+(-1))\text{ (k }\text{ times)}\end{equation*} So the sum is \begin{equation*}\sum_{d\text{ that work}}(-1)^{\omega(d)}=(1+(-1))^{k}=0\, .\end{equation*} This finishes the proof.