Are neither open nor closed sets in the Euclidean space locally compact? It is known that the Euclidean space $\mathbb{R}^n$ is locally compact, and that all open or closed subsets of a locally compact Hausdorff space are locally compact. What can we say about neither open nor closed subsets in the Euclidean space? Are they locally compact?
 A: 
Claim: If $X$ is locally compact Hausdorff, then a subset $A\subseteq X$ is locally compact in the subspace topology if and only if it is locally closed.

Here a subset $A$ is locally closed if it is open in its closure $\overline A$. Equivalently if $A$ is the intersection $U\cap C$ of an open subset $U\subseteq X$ and a closed subset $C\subseteq X$.
Proof of claim: $\Rightarrow$ Suppose $A$ is locally compact. To show that it is locally closed in $X$ it will suffice to show that each point $x\in A$ has an open neighbourhood $U\subseteq X$ such that $U\cap\overline A\subseteq A$. Proceed as follows. Since $A$ is locally compact there is a compact $K\subseteq A$ and an open $U\subseteq X$ such that $x\in U\cap A\subset K\subset A$. Then $K$ is also compact in $X$, and hence closed there too, since $X$ is Hausdorf. Thus $\overline{U\cap A}\subset K\subset A$. Now notice that $U\cap\overline A\subseteq \overline{U\cap A}$. For if $y\in U\cap\overline A$ and $V$ is any neighbourhood of $y$, then $U\cap V$ is a a neighbourhood of $y$, which therefore meets $A$, so $V\cap(U\cap A)=(U\cap V)\cap A\neq\emptyset$ and hence $x\in \overline{U\cap A}$. Thus we have $x\in U\cap \overline A\subset \overline{U\cap A}\subseteq A$, as required.
$\Leftarrow$ The subset $\overline A$ is locally compact as it is closed in the locally compact space $X$. Thus if $A$ is an open subset of $\overline A$, then $A$ is also locally compact. $\square$
Remarks: The first part of the proof establishes that any locally compact subspace of a Hausdorff space $X$ is locally closed (regarless of whether $X$ itself is locally compact). The second part of the proof establishes that any locally closed subset of a locally compact space is locally compact (regardless of any separation assumptions. Here the correct definition of local compactness is that each point have a base of compact neighbourhoods).
Examples: 1. Any half-open interval $[a,b)$ or $(a,b]$ is a locally compact subspace of $\mathbb{R}$ which is neither open nor closed. Since finite products of locally compact spaces are locally compact, $\prod^{n}_{i=1}[a_i,b_i)$ and $\prod^{n}_{i=1}(c_i,d_i]$ and mixed products thereof are locally compact subspaces of $\mathbb{R}^n$, and in particular locally closed there. 2. Neither $\mathbb{Q}$ nor its complement $\mathbb{P}=\mathbb{R}\setminus\mathbb{Q}$ is locally compact, since neither is locally closed in $\mathbb{R}$. Products like $\mathbb{Q}^n$ and $\mathbb{P}^n$ are not locally closed in $\mathbb{R}^n$ and are not locally compact.
