For a positive integer $n$, prove that: $$\sum_{d\mid n} (-1)^{n/d} \cdot \varphi(d) = \begin{cases} 0 & \text{if $n$ is even} \\ -n & \text{if $n$ is odd} \end{cases}$$
I can't even think, how, to begin with, this problem, please provide easy proof of this.
When $n $ is even, then we will have terms $(d,2d, 4d,\cdots, 2^kd)$, such that $d$ is odd and $d, 2d, 4d,\cdots, 2^kd |n$. Also $\frac{n}{2^kd}$ is odd, but for other terms it is even. Now, $$ (-1)^{n/d}\phi(d)+(-1)^{n/2d}\phi(2d)+\cdots+(-1)^{n/2^{k-1}d}\phi(2^{k-1}d)+(-1)^{n/2^kd}\phi(2^kd) =\phi(d)+\phi(d)+2\phi(d)+\cdots+2^{k-2}\phi(d)-2^{k-1}\phi(d) =\phi(d)+(2^{k-1}-1)\phi(d)-2^{k-1}\phi(d)=0 $$ Hence for even $n$, $\sum_{d|n}(-1)^{n/d}\phi(d)=0.$
When $n $ is odd, $(-1)^{n/d}=-1$. Hence, for odd $n$, $\sum_{d|n}(-1)^{n/d}\phi(d)=-\sum_{d|n}\phi(d)=-n$.