Claim: If $k$ is co-prime to $n$, so is $n-k$.
Proof: By Bezout's theorem, there exist integers $x,y$ such that $xn+yk=1$. Now, note that $$xn+yk = xn+yn-yn+yk = (x+y)n+(-y)(n-k) = 1$$
Therefore, since a linear combination of $n-k$ and $n$ sums to $1$, it follows that these are also co-prime.
Hence, it follows that these numbers come in pairs, and distinct pairs, because if $k=n-k$, then $2k=n$, so $k,n$ won't be co-prime (unless $k=1$, but the claim is true for $k=1$ anyway). Furthermore, the sum of these pairs is $n-k+k=n$.
How many are the number of pairs? Well, there are precisely $\phi(n)$ co-prime numbers to $n$, which are less than $n$. Hence the number of pairs formed is $\frac{\phi(n)}{2}$, and the sum of each pair is $n$, so it follows that the total sum of all the co-prime numbers is $\frac{n\phi(n)}{2}$.
Example: For $9$, the co-prime numbers are $1,2,4,5,7,8$. They form pairs, $(1,8), (2,7),(4,5)$. Each pair sums to $9$, so the total is 27. Also, $\phi(9)=6$, and $\frac{9 \times \phi(9)}{2}=27$.