There are $n\geq 3$ pupils standing in a circle, and always facing the teacher that stands at the centre of the circle. Each time the teacher whistles, two arbitrary pupils that stand next to each other switch their seats, while the others stands still. Find the least number $M$ such that after $M$ times of whistling, by appropriate switchings, the pupils stand in such a way that any two pupils, initially standing beside each other, will finally also stand beside each other; call these two pupils $ A$ and $ B$, and if $ A$ initially stands on the left side of $ B$ then $ A$ will finally stand on the right side of $ B$.
To solve this problem, we need to determine the minimum number of switches required to reverse the order of pupils standing in a circle such that any two pupils initially standing beside each other will still be beside each other, but in the reversed order.

1. **Understanding the Problem:**
   - We have \( n \geq 3 \) pupils standing in a circle.
   - Each time the teacher whistles, two adjacent pupils switch places.
   - We need to reverse the order of the pupils in the circle.

2. **Analyzing the Circle:**
   - Let's label the pupils as \( P_1, P_2, \ldots, P_n \) in clockwise order.
   - After the required number of switches, the pupils should be in the order \( P_n, P_{n-1}, \ldots, P_1 \).

3. **Strategy for Switching:**
   - To reverse the order, we can use a series of adjacent swaps.
   - Each swap will move a pupil closer to its final position in the reversed order.

4. **Counting the Minimum Number of Switches:**
   - Consider the position of each pupil in the final arrangement.
   - For \( P_1 \) to move to the position of \( P_n \), it needs to pass through \( n-1 \) positions.
   - Similarly, \( P_2 \) needs to move \( n-2 \) positions, and so on.
   - The total number of swaps required can be calculated by summing the number of swaps needed for each pupil.

5. **Summing the Swaps:**
   - The total number of swaps required is the sum of the first \( n-1 \) natural numbers:
     \[
     \sum_{i=1}^{n-1} i = \frac{(n-1)n}{2}
     \]

6. **Conclusion:**
   - Therefore, the minimum number of switches \( M \) required to reverse the order of the pupils in the circle is:
     \[
     M = \frac{(n-1)n}{2}
     \]

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