This question was asked in a test and I could not solve it and unfortunately don't completely understand the solution.
I am following Apostol Analytic number theory.
Question: consider f to be a multiplicative function and $f= 1\ast g$ so that $ g= \mu \ast f$ and $ g (p^k) = \sum_{ d | p^k} \mu( p^{k}/d) f(d) = f(p^k) - f(p^{k-1}) \geq 0$.
So, $ M_f(x) = \sum_{n \leq x} \sum_{d|n} g(d) \leq x \times \sum_{n\leq x} \frac{ g(d) } {d}$ .
I am unable to deduce the the RHS of the statement. I tried writing LHS as $\sum_{n \leq x} \sum_{d\leq x } g(d) 1_{[d|n]}$ but this doesn't helps deducing RHS because I am unable to take x out of it.
Note that for a fixed number $m,$ the term $g(m)$ appears in the sum $\sum_{n \leq x} \sum_{d \mid n} g(d)$ one time for each multiple $km$ of $m$ with $km \leq x.$ Thus, $g(m)$ will appear $\lfloor x/m\rfloor$ times in the sum, aka at most $x/m$ times. So, $$M_f(x) \leq \sum_{m\leq x} \frac{x}{m}g(m),$$ which of course rearranges to your bound.