As is pointed out in the comments $(k,n)=(n-k,n)$ so for every $k$ in your sum you'll also have $n-k$. So $$\sum_{1\leq k\leq n}k=\sum_{1\leq k\leq \frac{n}{2}}(k+n-k)=\frac{\phi(n)n}{2}$$
Notice that we cannot have $k=n-k$, since $n=2k$ would imply that they aren't coprime.
As is pointed out in the comments $(k,n)=(n-k,n)$ so for every $k$ in your sum you'll also have $n-k$. So $$\sum_{1\leq k\leq n}k=\sum_{1\leq k\leq \frac{n}{2}}(k+n-k)=\frac{\phi(n)n}{2}$$
Notice that we cannot have $k=n-k$, since $n=2k$ would imply that they aren't coprime.