I need some help with the last(?) step in a proof and I'm not sure how I should proceed... $\mu(n)$ is the Möbius function and $\omega(n)$ is the number of distinct prime factors. We see that for $n$ prime,
$$\sum_{d \mid n}\mu(d)\omega(n/d )=\mu(1)\omega(n)+\mu(n)\omega(1)=1.$$
But for $n$ composite I'm at a loss. My idea is to somehow show that if $n=p_1^{a_1}p_2^{a_2}\ldots p_k^{a_k}$, then the terms in the following sum will cancel each other, like this:
$$\sum_{d \mid n}\mu(d)\omega(n/d )=\omega(n)-\sum\omega\left(\frac{n}{p_i}\right)+\sum\omega\left(\frac{n}{p_ip_j}\right)+\ldots+\sum\omega\left(\frac{n}{p_1p_2\ldots p_k}\right)(-1)^{k},$$
where we just skip the divisors with exponent $a_i>1$ since $\mu$ would cancel them. Is there a way to achieve this? Or is this nonsense?
Added (clarification):
For $n=p_1^{a_1}p_2^{a_2}\ldots p_k^{a_k}$, $$\sum_{d \mid n}\mu(d)\omega \left( \frac{n}{d} \right)=\omega(n)+\underbrace{\mu(p_1) \omega(n/p_1)+ \ldots+\mu(p_k) \omega(n/p_k)}_{-\sum\omega\left(\frac{n}{p_i}\right)}+ \ldots + \mu(p_1 \ldots p_k) \omega\left(\frac{n}{p_1\ldots p_k}\right)$$ where $\mu(p_i)=-1$ and $\mu(p_1 \ldots p_k)=(-1)^{k}$. So we don't sum terms with square factors since they would be 0 in any case.
Let $P_i(k)$, $i=1,2,...\binom{\omega(n)}{k}$, be an enumeration of the products of $k$ of the prime factors of $n$, and $\nu(n)$ be the number of prime factors of $n$ with exponent $1$. Then $\binom{\nu(n)}{j}$ is the number of ways to choose $j$ primes with exponent $1$, and $\binom{\omega(n)-\nu(n)}{k-j}$ is the number of ways to choose $k-j$ primes with exponent greater than $1$. The primes with exponent $1$ in $n$ appearing in $P_i(k)$ decreases $\omega(\frac{n}{P_i(k)})$ to $\omega(n)-j$. Thus, $$ \begin{align} \sum_{i=1}^{\binom{\omega(n)}{k}}\omega(\frac{n}{P_i(k)}) &=\sum_{j=0}^k \binom{\nu(n)}{j}\binom{\omega(n)\!-\!\nu(n)}{k\!-\!j}(\omega(n)\!-\!j)\\ &=\binom{\omega(n)}{k}\omega(n)-\sum_{j=0}^k \;j\binom{\nu(n)}{j}\binom{\omega(n)\!-\!\nu(n)}{k\!-\!j}\\ &=\binom{\omega(n)}{k}\omega(n)-\sum_{j=1}^k \;\nu(n)\binom{\nu(n)\!-\!1}{j\!-\!1}\binom{\omega(n)\!-\!\nu(n)}{k\!-\!j}\\ &=\binom{\omega(n)}{k}\omega(n)-\binom{\omega(n)\!-\!1}{k\!-\!1}\nu(n) \end{align} $$ Because $\sum_k \binom{\omega(n)}{k}\;(-1)^k = 1$ when $\omega(n)=0$ and $0$ otherwise, we get that your alternating sum is $0$ when $\omega(n)=0$ and $\nu(n)$ when $\omega(n)=1$ and $0$ when $\omega(n)>1$.
$\omega(n)=0$ only when $n=1$. $\omega(n)=1$ and $\nu(n)=1$ only when $n$ is prime. When $n$ is composite, either $\omega(n)>1$ or $\nu(n)=0$. This should handle all cases.