I'm learning about the Möbius Inversion Formula but I'm stuck on an exercise which involves the Möbius function.
Let $n\in\mathbb{Z}$ with $n>0$ and let $\omega(n)$ denote the number of distinct prime numbers dividing n. Prove that
$$\sum_{d|n,d>0} |\mu(d)| = 2^{\omega(n)}$$
I can see that $\sum|\mu(d)|$ is divisible by $2$ but I don't know how to relate it to $\omega(n)$. Could someone give me a hint in the right direction on how to approach this proof?
Hint: Suppose that $P = \{p_1,\ldots,p_{\omega(n)}\}$ are the distinct primes divising $n$. Then $\mu(d) \neq 0$ (and so $|\mu(d)| = 1$) for $d|n$ only if $d$ is a product of a subset of $P$.