Solution (source code)

= Solution

Write $T_n=h(\{x\in\mathbb R:|x|>n\})$, making explicit that these are <subsets> of $Y$. If $p\notin h[\mathbb R]$ and $U$ is an open <neighbourhood> of $p$, then $h([-n,n])$ is <compact> and hence closed in $Y$. The <open set> $U\setminus h([-n,n])$ still contains $p$ and meets the <dense> image of $h$. Such an <intersection> point belongs to $T_n$, so $p\in\overline{T_n}$ for every $n$.

Conversely, if $p=h(x)$ choose an integer $n>|x|$. Since $h$ is an <topological embedding>[embedding], there is an open <neighbourhood> $U$ of $p$ in $Y$ whose <intersection> with $h[\mathbb R]$ is $h((-n,n))$. It misses $T_n$, so $p\notin\overline{T_n}$. Hence
$$
\boxed{Y\setminus h[\mathbb R]=\bigcap_{n\in\omega}\overline{T_n}^{\,Y}.}
$$
For the <two ends of a real-line compactification>, let $A_n^+=\overline{h((n,\infty))}$ and $A_n^-=\overline{h((-\infty,-n))}$. Each is nonempty <compact> and <connected>, being the <closure> of a <connected> image. The two nested families therefore have nonempty <connected> intersections $C^+$ and $C^-$. Since <closure> commutes with finite unions, $\overline{T_n}=A_n^+\cup A_n^-$. Moreover
$$
\bigcap_n(A_n^+\cup A_n^-)=C^+\cup C^-.
$$
For if a point fails both intersections, it fails one positive member and one negative member, hence both members at the larger index by nesting.

If the remainder were a finite three-point <set>, its Hausdorff <subspace topology> would be discrete. Each nonempty <connected subset> $C^\pm$ would then be a <singleton>, so their <union> would have at most two points. This contradiction proves \b[there is no three-point <Hausdorff compactification> of the <real line>]. The argument does not assert that every possible remainder is finite.