Construct a sequence whose limit points are exactly a given closed set $F$ Given a closed set $F$ of $\mathbb{R}$, show there exists a sequence in $\mathbb{R}^\mathbb{N}$ whose set of limit points is exactly $F$.
Under what conditions does this hold if we replace $\mathbb{R}$ by a metric space $E$?

After thinking for some time about the first question my professor showed me a means of constructing the sequence, but it was completely unmotivated. So some motivation would be nice when describing your construction!
 A: Let $(X; d)$ be a separable metric space and let $C$ be closed in $(X;d)$. Fix a countable basis $B$ for the topology of $(X;d)$ and fix a countable dense set $D$ such that for all $O \in B$
$$
O \cap C \neq \emptyset \implies D \cap C \neq \emptyset.
$$
(This is possible since we may just add those countably many points to a given dense set.) Now let
$$
D' := D \cap C = \{d_n \mid n \in \mathbb N\}.
$$
and fix a function
$$
x \colon \mathbb N \to D'
$$
such that $x^{-1}[\{d\}]$ is infinite for all $d \in D'$. (This can easily be arranged, e.g. by setting $f(p_n^k) = d_n$ for all $k$, where $p_n$ is the $n$th prime number.)
Let us write
$$
(x_n \mid n \in \mathbb N) := (x(n) \mid n \in \mathbb N).
$$
Since $\{x_n \mid n \in \mathbb N \} \subseteq C$ and $C$ is closed, every accumulation point of $(x_n \mid n \in \mathbb N)$ is in $C$.
Conversely, if $x \in C$, fix a strictly increasing function
$$
f \colon \mathbb N \to \mathbb N
$$
such that for all $n \in \mathbb N$
$$
x_{f(n)} \in B(x, 2^{-n}) := \{ y \in X \mid d(x,y) < 2^{-n} \}.
$$
This is possible because there is some $O \in B$ with $x \in O \subseteq B(x, 2^{-n})$ and for this $O$ there is, by our choice of $D$ some $x_{m} \in D \cap C$. Let $f(n)$ be large enough such that $f$ stays strictly increasing and $x_{f(n)} = x_m$. 
Now the subsequence
$$(x_{f(n)} \mid n \in n \in \mathbb N)$$
witnesses that $x$ is an accumulation point of $(x_n \mid n \in \mathbb N)$.

Note that this is optimal: If $(X;d)$ is a metric space and $(x_n \mid n \in \mathbb N)$ is a sequence such that $X$ is equal to the set of accumulation points of $X$, then
$$
\{ x_n \mid n \in \mathbb N \}
$$
is a countable dense subset of $(X;d)$ and hence $(X;d)$ is separable.
Proof. Let $O$ be a nonempty open subset of $(X;d)$ and fix $x \in O$. Since $x$ is an accumulation point of $(x_n \mid n \in \mathbb N)$ there is some $n \in \mathbb N$ such that $x_n \in O$. Q.E.D.
