TITLE: Show $\sum\limits_{d|n}\phi(d) = n$.
QUESTION [9 upvotes]: Show $\sum\limits_{d|n}\phi(d) = n$. 
Example : $\sum\limits_{d|4}\phi(d) = \phi(1) + \phi(2) + \phi(4) = 1 + 1 + 2 = 4$
I was told this has a simple proof. Problem is, I can not think of a way to show this in a very simple and straightforward way.

REPLY [2 votes]: Consider the set $[n]=\{1,2,\ldots,n\}$ of size $n$. Define an equivalence relation as follows $$m\sim m'\iff (m,n)=(m',n)$$ That this is an equivalence relation should be clear. The equivalence classes are of the form $$\widehat m=\{0<m'\leqslant n:(m',n)=d\}$$ where $d=(m,n)\mid n$.  Now, what is the size of this class? It contains all positive elements $m'\leqslant n$ such that $(m',n)=d$, or what is the same, all positive elements $$\frac{m'}d\leqslant \frac nd$$ such that $$\left(\frac{m'}{d},\frac nd \right)=1$$
This amounts to $\varphi\left(\dfrac nd\right)$ elements. But there is one class for each positive divisor of $n$, thus we have paititioned our set getting $$n=\sum_{d\mid n}\varphi\left(\dfrac nd\right)$$
But as $d$ runs through all divisors of $n$; so does $\dfrac nd$, so that $$n=\sum_{d\mid n}\varphi(d)$$