Please, help me to prove that there is a multiplicative arithmetical function $g$ such that $$\sum_{k=1}^n f(\gcd(n,k)) = \sum_{d\mid n} f(d)g(\tfrac{n}{d})$$ for every arithmetical function $f$.
This Example is in textbook : Introduction Number Theory. TOM.M.APOSTOL.
By dividing case, the left sum term can be expressed as $$\sum_{(n,k)=1} f((n,k)) + \sum_{(n,k)>1} f((n,k))$$ and we can know that the first term is equal to $\phi(n)f(1)$.
And how can I do later?
We have $$\sum_{k=1}^{n}f\left(\left(n,k\right)\right)=\sum_{d\mid n}f\left(d\right)\sum_{\underset{{\scriptstyle \left(k,n\right)=d}}{k=1}}^{n}1 $$ and now note that $$\sum_{\underset{{\scriptstyle \left(k,n\right)=d}}{k=1}}^{n}1=\sum_{\underset{{\scriptstyle \left(k/d,n/d\right)=1}}{k/d\leq n/d}}1=\phi\left(\frac{n}{d}\right) $$ where $\phi\left(n\right) $ is the Euler totient function. Hence $g=\phi $ and $$\sum_{k=1}^{n}f\left(\left(n,k\right)\right)=\sum_{d\mid n}f\left(d\right)\phi\left(\frac{n}{d}\right). $$