If a1, a2,..., aφ(m) are the numbers less than m and prime to it.
Consider the number a with (a,m) = 1
Now. the numbers aa1, aa2,..., aaφ(m) are again all prime to m. Further they are all distinct modulo m as for all r, s ≤ φ(m) we have a (ar-as) is not divisible by m.
That means by pigeon-hole aa1, aa2,..., aaφ(m) are congruent to a1, a2,..., aφ(m) in some order
Hence ( aa1) (aa2) ... (aaφ(m)) ≡ a1 a2 aφ(m) mod m
or aφ(m)≡1 mod m