5. Given a positive integer $n$, how many distinct points must be appropriately selected on a plane so that the following property holds: for each $k \in\{1$, $2, \cdots, n\}$, there always exists a line on the plane that passes through exactly $k$ of the selected points. (2nd Test, 3rd Problem, 1992 Commonwealth of Independent States Mathematical Winter Camp)
Let $X$ denote the set of all selected points, and let $l_{k}$ represent a line that contains exactly $k$ points from $X$, where $k=1,2, \cdots, n$.

On one hand, since $l_{n}$ contains $n$ points from $X$, $l_{n-1}$ contains $n \cdots 1$ points from $X$, and at least $n-2$ points are not on $l_{n}$. $l_{n-2}$ contains $n-2$ points from $X$, and at least $n-2 \times 2$ points are not on $l_{n}$ and $l_{n-1}$, and so on. Therefore, the number of points in $X$, denoted as $|X|$, satisfies the following inequality:
$$
\begin{aligned}
|X| & \geqslant n+(n-2)+(n-2 \times 2)+\cdots+\left(n-2\left[\frac{n}{2}\right]\right) \\
& =\left(n-\left[\frac{n}{2}\right]\right)\left(\left[\frac{n}{2}\right]+1\right)=\left[\frac{n+1}{2}\right]\left[\frac{n+2}{2}\right] .
\end{aligned}
$$

On the other hand, using mathematical induction on $n$, we prove that for any positive integer $n$, there exists a set $X$ with exactly $\left[\frac{n+1}{2}\right]\left[\frac{n+2}{2}\right]$ points that satisfies the problem's conditions. For $n=1$ and $n=2$, we can take $X_{1}$ as a single point and $X_{2}$ as two points. Assume that for $n<m$, such $X_{n}$ exists. Consider the case when $n=m$. For $X_{m-2}$, where $l_{k}$ contains $k$ points from $X_{m-2}$, $k=1,2, \cdots, m \cdots 2$. Choose a line $l$ such that $l$ is not parallel to any line $i_{1}$ and does not pass through any intersection points of lines $l_{4}$ or any points in $X_{m-2}$. Let $l$ intersect $l_{k}$ at points $P_{k}(k=1,2, \cdots, m-2)$, and let $P_{m-1}$ and $P_{m}$ be two distinct points on $l$ different from $P_{2}, P_{2}, \cdots, P_{m-2}$. Combine the points $P_{1}, P_{2}, \cdots, P_{m}$ with the points in $X_{m-2}$ to form the set $X_{m}$. At this point, the number of points in $X_{m}$ is
$$
\begin{array}{l}
\left|X_{m}\right|=m+\left|X_{m-2}\right|=m+\left[\frac{m-1}{2}\right]\left[\frac{m}{2}\right] \\
=m+\left(\left[\frac{m+1}{2}\right]-1\right)\left(\left[\frac{m+2}{2}\right]-1\right) \\
=\left[\frac{m+1}{2}\right]\left[\frac{m+2}{2}\right] .
\end{array}
$$

The lines $l_{1}, l_{2}, \cdots, l_{m-1}, l$ contain $2,3, \cdots, m-1, m$ points from $X_{m}$, respectively, and it is easy to find a line that contains exactly one point from $X_{m}$. Thus, the constructed point set $X_{m}$ meets the requirements.