Let $S$ be the set of all integers $k$, $1\leq k\leq n$, such that $\gcd(k,n)=1$. What is the arithmetic mean of the integers in $S$?
1. **Cardinality of Set \( S \)**:
   - The set \( S \) consists of all integers \( k \) such that \( 1 \leq k \leq n \) and \(\gcd(k, n) = 1\).
   - The number of such integers is given by Euler's totient function \(\phi(n)\).

2. **Euler's Totient Function**:
   - Euler's totient function \(\phi(n)\) counts the number of integers up to \( n \) that are coprime with \( n \).
   - It is given by:
     \[
     \phi(n) = n \left(1 - \frac{1}{p_1}\right) \left(1 - \frac{1}{p_2}\right) \cdots \left(1 - \frac{1}{p_k}\right)
     \]
     where \( p_1, p_2, \ldots, p_k \) are the distinct prime factors of \( n \).

3. **Evenness of \(\phi(n)\)**:
   - For \( n > 2 \), \(\phi(n)\) is always even. This is because the product formula for \(\phi(n)\) involves terms of the form \(\left(1 - \frac{1}{p_i}\right)\), which are fractions less than 1. When multiplied together, they result in an even number.
   - For \( n = 2 \), \(\phi(2) = 1\), which is odd. However, for \( n = 1 \), \(\phi(1) = 1\), which is also odd. But these are special cases and do not affect the general proof.

4. **Pairing Elements in \( S \)**:
   - If \(\gcd(k, n) = 1\), then \(\gcd(n - k, n) = 1\) as well.
   - This allows us to pair each \( k \) with \( n - k \). Each pair sums to \( n \).

5. **Summing the Elements in \( S \)**:
   - Since \(\phi(n)\) is even, we can write \(\phi(n) = 2k\) for some integer \( k \).
   - We can form \( k \) pairs \((k, n - k)\) each summing to \( n \).
   - Therefore, the sum of all elements in \( S \) is:
     \[
     \sum_{\gcd(k, n) = 1} k = k \cdot n = \frac{\phi(n)}{2} \cdot n
     \]

6. **Arithmetic Mean of \( S \)**:
   - The arithmetic mean of the elements in \( S \) is given by:
     \[
     S_{\text{mean}} = \frac{\sum_{\gcd(k, n) = 1} k}{\phi(n)} = \frac{\frac{\phi(n)}{2} \cdot n}{\phi(n)} = \frac{n}{2}
     \]

\(\blacksquare\)

The final answer is \( \boxed{ \frac{n}{2} } \)