Proof by contradiction:
Assume that no one shook the same number of hands. That must mean that every possible number of hands shook from $0$ to $24$ occurs for exactly one person.
However, this is impossible, as one person shook $24$ hands, meaning he shook hands with everyone. But there is also someone who shook $0$ hands, shaking no one's hand.