TITLE: How is $[0,1]$ locally compact if 0 and 1 do not have a neighborhood in $[0,1]$?
QUESTION [6 upvotes]: I am a physics student and I am trying to learn the concept of compactness as I need it to understand some group theory issues. I am having trouble understanding the statement that every compact space is locally compact. I understand the open cover definition of compactness and could prove that $[0,1]$ is compact using the supremum method. Now, according to the definition on Wikipedia of local compactness, a topological space $X$ is locally compact if every point in $X$ has a compact neighborhood. My understanding is that neighborhood of a point $p$ in $X$ should contain an open set containing $p$ itself. It seems to me though that $0$ and $1$ in $[0,1]$ do not have open sets/intervals in $[0,1]$ which contain $0$ and $1$. Am I making a conceptual mistake here ? I am not an expert, so please forgive my stupidity here. Thank you.

REPLY [6 votes]: It's important to bear in mind the topology on $[0,1]$, which is the subspace topology inherited from $\mathbb{R}$.  Conferring with the definition of the subspace topology, you'll find that $[0,a)$ is an open set in $[0,1]$ for $0<a<1$, though indeed such a set is not open in $\mathbb{R}$.
As an aside, there is a theorem regarding local compactness for which this scenario arises as a special case:

Theorem: Let $X$ be a locally compact Hausdorff space.  If $U$ is either an open or a closed subset of $X$, then $U$ is itself locally compact.

Proof: We want to show that any point $x \in U$ has a compact neighborhood $L_x \subset U$.  To do this, we begin by noting that the local compactness of $X$ guarantees that $x$ has a compact neighborhood $K \subset X$.  This will serve as a starting point.
The intersection of a closed set and a compact set is itself compact, so our strategy going forward will be to find a (finite) collection of closed neighborhoods $\{ C_i \}$ of $x$ such that $\displaystyle K \cap \left( \bigcap_i C_i \right)$ is a proper subset of $U$ (necessarily compact).  A good step in the right direction is to take $K \cap \overline{U}$, which prunes away many points in $K \setminus U$.  
To get a third closed set $S$ so that $S \cap K \cap \overline{U} \subset U$, we can do the following:  note that $\partial U \cap K$ is compact because $\partial U$ is closed (where $\partial U$ denotes the boundary of $U$), and since $X$ is Hausdorff, we can cover $\partial U\cap K$ with open sets that are "far" from $x$.  Let $T$ be the union of the open sets contained in the finite subcover this will necessarily admit, and let $S = X \setminus T$ (which is a closed neighborhood of $x$).
$L_x = S \cap K \cap \overline{U}$ is a compact neighborhood of $x$ contained in $U$.

In this scenario, of course, $X = \mathbb{R}$ (a locally compact Hausdorff space), and $U = [0,1]$.