Let $X$ be a metric space such that every infinite set in it has a limit point. Prove that $X$ is separable
I've tried this question in following way:
Let $\{X_{1i},X_{2i},X_{3i}.....X_{ni}\}$ be infinite sets which has a limit point $\{x_1,x_2,x_3....x_n\}$ respectively. Since all above sequence has a limit point defined and contained in it, therefore we can call these sequence as closed sets $\{X_{11},X_{12},...,x_1\}, \{X_{21},X_{22},...,x_2\}......,\{X_{n1},X_{n2},....,x_n\}.$ Hence union of all these closed set is closed & closed set implies that it is compact. We know that compact metric space is separable. Therefore at end $X$ is separable.
Is my way of proof legitimate enough?
No, if $x_1$ is a limit point of $\{X_{1i}, X_{2i},\ldots\}$ it doesn't mean that $\{x_i, X_{1i}, X_{2i},\ldots\}$ is closed because for that we need all limit points to be in the set, not just the one.
It is however true that $X$ is compact if we know it's a metric space such that every infinite set has a limit point. But the proof for that goes along quite different lines. Several proofs of direct separability too can be found in the answers here. Take a look.