In the space $n \geq 3$ points are given. Every pair of points determines some distance. Suppose all distances are different. Connect every point with the nearest point. Prove that it is impossible to obtain (closed) polygonal line in such a way.
1. **Identify the smallest distance**: Consider the two points \( A \) and \( B \) that are connected by the smallest distance. Since all distances are different, the distance between \( A \) and \( B \) is unique and the smallest among all pairs.

2. **Connection by nearest point**: By the problem's condition, each point is connected to its nearest point. Therefore, \( A \) is connected to \( B \) and \( B \) is connected to \( A \).

3. **Count the edges**: Since \( A \) and \( B \) are connected by the smallest distance, they form an edge. This edge is counted once, even though it is the nearest connection for both \( A \) and \( B \).

4. **Consider the remaining points**: For the remaining \( n-2 \) points, each point will be connected to its nearest point. However, since all distances are different, no other pair of points can have the same distance as \( A \) and \( B \). This means that each of the remaining points will form unique edges with their nearest points.

5. **Total number of edges**: In total, we have \( n-1 \) edges because the edge between \( A \) and \( B \) is counted once, and each of the remaining \( n-2 \) points forms one unique edge with its nearest point.

6. **Closed polygonal line requirement**: For a closed polygonal line with \( n \) vertices, we need exactly \( n \) edges. However, we have established that we only have \( n-1 \) edges in our figure.

7. **Conclusion**: Since we have \( n-1 \) edges and not \( n \) edges, it is impossible to form a closed polygonal line with \( n \) vertices.

\[
\boxed{\text{It is impossible to obtain a closed polygonal line in such a way.}}
\]