9. A class has $m$ students, each of whom went to the swimming pool several times in September, with no one visiting twice on the same day. On October 1st, when the number of visits was counted, it was found that each person had gone a different number of times, and for any two people, there was a day when the first person went to the swimming pool and the second did not; conversely, there was also a day when the second person went to the swimming pool and the first did not. Find the maximum possible value of $m$.


9. $m=28$.

For each positive integer $n$, let
$$
X_{n}=\{1,2, \cdots, n\} \text {. }
$$

For each student, construct a set of positive integers, where the elements are the dates the student goes to the swimming pool (they are all subsets of $X_{30}$). Thus, we obtain a family of $m$ subsets of $X_{30}$ (by the problem, these subsets are non-empty). According to the problem, the number of elements in these subsets are all different, and these subsets do not contain each other. Such a family of subsets is called "good".

The problem to be solved is: What is the maximum number of subsets in a good family of subsets of $X_{30}$?

First, prove that a good family of subsets contains at most 28 subsets.

Obviously, in a good family of subsets, it is impossible to contain a 30-element set (because it contains any other subset as its own subset). This means that in all families of subsets, only 1-element sets, 2-element sets, ..., 29-element sets (no more than 29) can be contained.

Assume that in a good family of subsets, there is a 29-element set $A$ and a 1-element set $B$.

Since $B$ is not contained in $A$, they are disjoint. Thus, all other subsets of $X_{30}$ either contain the set $B$ or are contained in the set $A$. Therefore, the family of subsets contains only two subsets.

If the family of subsets does not contain a 29-element set or does not contain a 1-element set, then it contains at most 28 subsets.

Second, provide an example of a good family of 28 subsets of $X_{30}$.

For $k \geqslant 2$, prove by induction: There exists a good family of subsets $A_{1}, A_{2}, \cdots, A_{2 k-2}$ of $X_{2 k}$, and in the subset $A_{i} (i=1,2, \cdots, 2 k-2)$, there are $i+1$ elements.

For $k=2$, take $A_{1}=\{1,2\}$ and $A_{2}=\{1,3,4\}$.

Assume that for some $k$, a good family of subsets $B_{1}, B_{2}, \cdots, B_{2 k-2}$ of $X_{2 k}$ has been constructed. Construct a good family of subsets of $X_{2 k+2}$: For $i=1,2, \cdots, 2 k-2$, let $A_{i+1}=B_{i} \cup\{2 k+2\}$, these subsets contain $3,4, \cdots, 2 k$ elements respectively. Then let $A_{1}=\{2 k+1,2 k+2\}$ and $A_{2 k}=\{1,2, \cdots, 2 k+1\}$. It is not difficult to see that this family of subsets is a good family of subsets.
The induction step is completed.