The problem statement is:
Show that $S^n\cong\mathbb{R}^n\cup\{\infty\}.$
My attempt at the proof is as follows:
Let $f:S^n\to\mathbb{R}^n\cup\{\infty\}$ be defined as $f(x)=h(x)$ for $x\neq p$ and $f(x)=\infty$ for $x=p$, where $h$ is the homeomorphism between $S^n-\{p\}$ and $\mathbb{R}^n$.
Since $h$ is bijective, $f(p)=\infty$ and $f^{-1}(\{\infty\})=p$, it's clear that $f$ too is bijective. We must show that $f$ and $f^{-1}$ are continuous. To begin, let $O\subset\mathbb{R}^n\cup\{\infty\}$ be open. Then $O\subset\mathbb{R}^n$ or $O=K^c\cup\{\infty\}$ for some compact $K\subset\mathbb{R}^n$. If $O\subset\mathbb{R}^n$ then $f^{-1}(O)=h^{-1}(O)$, which we know is open since $h$ is continuous.
Now, if $O=K^c\cup\{\infty\}$ then we have $f^{-1}(O)=f^{-1}(K^c\cup\{\infty\})=f^{-1}(K^c)\cup f^{-1}(\{\infty\})=(f^{-1}(K))^c\cup\{p\}=(h^{-1}(K))^c\cup\{p\}.$
This is where I get stuck in the proof. What I want to say is since $h:S^n-\{p\}\to\mathbb{R}^n$, $(h^{-1}(K))^c\subset S^n-\{p\}$ and so we really have $S^n-h^{-1}(K)$, which is open because $h^{-1}(K)$ is compact, more specifically closed and bounded, since $K$ is compact and $h^{-1}$ is continuous. Afterword, I figure showing $\,f^{-1}$ is continuous will be a similar argument.
Another approach I wanted to take was to consider $S^n-\{p\}\cong\mathbb{R}^n$. Then since the one point compactification preserves homeomorphisms between sets, we must have $S^n-\{p\}\cup\{p\}=S^n\cong\mathbb{R}^n\cup\{\infty\}.$ In the text I'm reading, the one point compactification adds $\infty$, to add a different point, do we need to only confirm that $S^n-\{p\}$ is a locally compact Hausdorff space? That way, we satisfy the hypothesis for one point compactification?
Thank you for any help or feedback!