TITLE: Proving that $\varphi(n)=n\prod (1-1/p)$ without using multiplicativity
QUESTION [6 upvotes]: $$\varphi(n)=n\prod_{p \ \text{prime}} (1-1/p)$$
Can this useful formula be derived without using the fact that Euler's totient function is multiplicative?

REPLY [5 votes]: Let $n=\prod_{i=1}^{k}p_{i}^{a_i}$ where the $p_i$'s are distinct primes and the $a_i$'s are all $\geq1$.
Let $A_i$ denote the subset of $\{1,2,\ldots, n\}$, all of whose elements are divisible by $p_i$. Then the set $A := \{m|1 \leq m \leq n, {\rm gcd}(m,n) \gt 1\}$ is precisely the union of the $A_i$'s and we have, from the principle of inclusion-exclusion,
$$|A|=\sum_i|A_i| - \sum_{i<j}|A_i \cap A_j| + \sum_{i<j<k}|A_i\cap A_j \cap A_k|-\cdots$$
which gives us, 
$$|A|=\sum_i \frac{n}{p_i}-\sum_{i<j}\frac{n}{p_ip_j}+\sum_{i< j < k} \frac{n}{p_ip_jp_k}-\cdots.$$
Thus, $$\phi(n)=n-|A|=n-\sum_i \frac{n}{p_i}+\sum_{i<j}\frac{n}{p_ip_j}-\sum_{i< j < k} \frac{n}{p_ip_jp_k}+\cdots$$
giving us the result, 
$$\phi(n)=n\prod_{i=1}^{k}(1-\frac{1}{p_i})=n\prod_{p|n}(1-\frac{1}{p}).$$