Example 14 Given $n$ points $p_{1}, p_{2}, \cdots, p_{n}$ in a plane, no three of which are collinear, each point $p_{i}(1 \leqslant i \leqslant n)$ is arbitrarily colored red or blue. Let $S$ be the set of triangles whose vertex set is $\left\{p_{1}, p_{2}, \cdots, p_{n}\right\}$, and has the property: for any two line segments $p_{i} p_{j}$ and $p_{u} p_{v}$, the number of triangles in $S$ that have $p_{i} p_{j}$ as a side is the same as the number of triangles in $S$ that have $p_{u} p_{v}$ as a side. Find the smallest $n$ such that $S$ always contains two triangles, each of whose vertices have the same color.
(48th IMO China National Training Team Test Question)
Let the number of triangles in $S$ with $p_{i} p_{j}$ as an edge be $k$, then $k$ is a positive integer and is independent of $i, j$. Since there are $C_{n}^{2}$ edges $p_{i} p_{j}$, there are $k \cdot C_{n}^{2}$ triangles (including repeated counts). Each triangle has three edges, and each triangle is counted 3 times in the above count, so $|S|=\frac{1}{3} k C_{n}^{2}$. Let the number of triangles in $S$ with vertices of the same color be $x$, then the number of triangles in $S$ with vertices not all the same color is $\frac{1}{3} k C_{n}^{2}-x$. Each triangle with vertices not all the same color produces two edges with different colored endpoints (referred to as different colored edges), so $S$ has $2\left(\frac{1}{3} k C_{n}^{2}-x\right)$ different colored edges.

On the other hand, let $p_{1}, p_{2}, \cdots, p_{n}$ have $n_{1}$ red points and $n_{2}$ blue points, with $n_{1}+n_{2}=n$. By assumption, each different colored edge appears $k$ times in the triangles of $S$, so there are $k n_{1} n_{2}$ different colored edges, thus
$$
2\left(\frac{1}{3} k C_{n}^{2}-x\right)=k n_{1} n_{2} .
$$

Solving for $x$ gives
$$
\begin{aligned}
x & =\frac{k}{6}\left(2 C_{n}^{2}-3 n_{1} n_{2}\right)=\frac{k}{6}\left(n^{2}-n-3 n_{1} n_{2}\right) \\
& \geqslant \frac{k}{6}\left[n^{2}-n-3\left(\frac{n_{1}+n_{2}}{2}\right)^{2}\right]=\frac{k}{6} n\left(\frac{n}{4}-1\right)=\frac{k}{24} n(n-4) .
\end{aligned}
$$

Therefore, when $n \geqslant 8$, since $k \geqslant 1$, we have
$$
x \geqslant \frac{n}{24}(n-4) \geqslant \frac{8 \times 4}{24}=\frac{4}{3}>1 \text {. }
$$

Thus, $x \geqslant 2$, so $n \geqslant 8$.
When $n=7$, the conclusion is not necessarily true. For example, if points $1,2,4$ are colored red and points $3,5,6,7$ are colored blue, then the set of triangles $\{1,2,4\},\{2,3,5\},\{3,4,6\},\{4,5,7\},\{5,6,1\},\{6,7,2\},\{7,1,3\}$ meets the requirement (each edge appears in one triangle), but there is only one same-colored triangle $\{1,2,4\}$.
Therefore, the smallest positive integer $n=8$.