I shall define some functions first. For $n$ being any positive integer,
$ω(n) =$ no. of distinct primes $p$ which divides $n$.
$\mu(n) = (-1)^{ω(n)}$ if $n$ is square-free; $= 0$ if not.
$s(n) =$ the largest square-free factor of $n = \prod_{p|n} p$.
How can we show that $$\sum_{d|n} d\mu(d) = ((-1)^{ω(n)}ϕ(n)s(n))/n?$$
Many thanks.
With $p|n$ the primes dividing $n$ we get for the LHS
$$\prod_{p|n} (1+\mu(p)p) = \prod_{p|n} (1-p).$$
We get for the RHS
$$(-1)^{\omega(n)} \times n \times \prod_{p|n} \left(1-\frac{1}{p}\right) \times \prod_{p|n} p \times \frac{1}{n} \\ = (-1)^{\omega(n)} \prod_{p|n} \left(1-\frac{1}{p}\right) \times \prod_{p|n} p \\ = (-1)^{\omega(n)} \prod_{p|n} \left(p-1\right) \\ = \prod_{p|n} \left(1-p\right).$$
This is the claim.