In the book Topology by Munkres, at page 184, it is given the existence and uniqueness of one point compactification of a locally compact Hausdorff space; however, in the existence part, I can't see where we needed the locally compactness of that space, and this raised the question:
Does one point compactification of a Hausdorff space always exist (even though it is not unique) ?
See the proof in the book;
(sorry for the images; they are just for reference for those that doesn't have the book with them)



For any space $X$ we can construct a space $\alpha(X)$, the Aleksandrov extension of $X$ by defining a space $Y$ as Munkres does with the extra provision that we take all complements of closed compact subsets of $X$ as the extra neighbourhoods for $\infty$. One can easily check that $\alpha(X)$ is then compact.
The "closed" is needed in general because if e.g. $X$ is not Hausdorff it could have some compact subset $K$ which is not closed, and then (if we were to omit the closed condition) $(X\setminus K) \cup \{\infty\}$ would be open while its intersection with $X$ would be $X\setminus K$, which was not open, so if we left out the closed condition $X$ would not have the same topology as a subspace of $\alpha(X)$ as originally, going against the idea of an extension/compactification: we want to embed $X$ in a larger space with better properties, so in the larger space it should be a subspace with the same topology that it had originally.
If we want $Y = \alpha(X)$ to be Hausdorff, (so in particular $X$ should then be Hausdorff, as a subspace of $Y$) we need to be able to separate $\infty$ from every point $x$ in $X$. As a neighbourhood of $\infty$ is of the form $\{\infty\} \cup X \setminus C$, with $C$ compact and closed, every point $x$ should then have a neighbourhood that sits inside a compact closed set, i.e. $X$ must be locally compact.
So $\alpha(X)$ can always be defined such that $\alpha(X)\setminus X$ is a point and $X$ is a subspace of $\alpha(X)$ and it is always compact (regardless of $X$) but $\alpha(X)$ is Hausdorff iff $X$ is locally compact and Hausdorff. A special case is when $X$ is already Hausdorff and compact, in which case we add an isolated point $\infty$ (as $X$ can be taken as $C$, a compact closed subset) and we get that $X$ is not dense in $\alpha(X)$.
Normally we only consider Hausdorff compactifications and in that case the local compactness is needed for the Hausdorffness of the construction $\alpha(X)$. And also because then $X$ is an open subset of a compact Hausdorff space and thus locally compact for that reason.