Let $S$ be a subset of $\{1,2, \ldots, 9\}$, such that the sums formed by adding each unordered pair of distinct numbers from $S$ are all different. For example, the subset $\{1,2,3,5\}$ has this property, but $\{1,2,3,4,5\}$ does not, since the pairs $\{1,4\}$ and $\{2,3\}$ have the same sum, namely 5.

What is the maximum number of elements that $S$ can contain?
It can be checked that all the sums of pairs for the set $\{1,2,3,5,8\}$ are different.

Suppose, for a contradiction, that $S$ is a subset of $\{1, \ldots, 9\}$ containing 6 elements such that all the sums of pairs are different. Now the smallest possible sum for two numbers from $S$ is $1+2=3$ and the largest possible sum is $8+9=17$. That gives 15 possible sums: $3, \ldots, 17$.

Also there are $\left(\begin{array}{l}6 \\ 2\end{array}\right)=15$ pairs from $S$. Thus, each of $3, \ldots, 17$ is the sum of exactly one pair. The only pair from $\{1, \ldots, 9\}$ that adds to 3 is $\{1,2\}$ and to 17 is $\{8,9\}$. Thus $1,2,8,9$ are in $S$. But then $1+9=2+8$, giving a contradiction. It follows that the maximum number of elements that $S$ can contain is 5.