We have the arithmetic function $$f(n)=\sum_{d\mid n}\mu (d)\cdot d$$ I want to show that $f\left (p_1^{e_1}\cdots p_k^{e_k}\right )=(-1)^k\cdot (p_1-1)\cdots (p_k-1)$.
We have that $d$ is of the form $p_1^{a_1}\cdots p_k^{a_k}$ with $0\leq a_i\leq e_i$ right?
So $$f\left (p_1^{e_1}\cdots p_k^{e_k}\right )=\sum_{d\mid n}\mu (d)\cdot d=\sum_{0\leq a_i\leq e_i, \forall i}\mu (p_1^{a_1}\cdots p_k^{a_k})\cdot p_1^{a_1}\cdots p_k^{a_k}$$ or not?
How could we continue?
Yes, you are correct so far. Now by the multiplicative property of the Mobius function and its definition, it follows that $$\begin{align*}\sum_{0\leq a_i\leq e_i, \forall i}\mu (p_1^{a_1}\cdots p_k^{a_k})\cdot p_1^{a_1}\cdots p_k^{a_k}&= \sum_{0\leq a_i\leq e_i, \forall i}\mu (p_1^{a_1})\cdots \mu(p_k^{a_k})\cdot p_1^{a_1}\cdots p_k^{a_k}\\&= \sum_{0\leq a_i\leq 1, \forall i}(-1)^{a_1}\cdots (-1)^{a_k}\cdot p_1^{a_1}\cdots p_k^{a_k}\\&= \sum_{0\leq a_1\leq 1}(-p_1)^{a_1}\dots\sum_{0\leq a_k\leq 1}\cdots (-p_k)^{a_k}\\&=(1-p_1)\cdots(1-p_k)\\ &=(-1)^k\cdot (p_1-1)\cdots (p_k-1).\end{align*}$$