I want to show that subspace of $\mathbb R$ is locally compact.
Let $W$ be subspace of $\mathbb R$. Let $x\in W$ and $y\in \mathbb R \setminus W$. Since $\mathbb R$ is Hausdorff space, there exists disjoint open sets $U$ and $V$ such that $x\in U$ and $y\in V$ for $x\in W$, $y\in \mathbb R \setminus W$. Then, $U\subseteq X \setminus V$ and $X\setminus V$ is closed in $\mathbb R$, so the closure of $U$ is contained in $X \setminus V $. Since the closure of $U$ is bounded and closed in $\mathbb R$, the closure is compact. Hence, there exists open set containing $x$ such that compact subset is contained in the open set. That means $W$ is locally compact.
Please let me know whether it's right or not.