Let $X$ and $Y$ be two topological spaces, and let $X^*$ and $Y^*$ denote their one-point compactification ($X^* := X \cup \{\infty\},\,\mathcal{T}^* := \{U \subseteq X^*\mid U \cap X \in \mathcal{T} \land (\infty \in U \implies U= (X \setminus K)\cup \{\infty\}$, $ K $ closed and compact$\}$).
Let $f:X\rightarrow Y$ be a continuous function. How can $f$ induce a continuous function between $X^*$ and $Y^*$?
My idea was to define $f^*(x)=f(x)$ for $x\neq \infty$ and $f^*(\infty)=\infty$. Then, let $U\subset Y^*$ be an open subset.
If $\infty\notin U$ then $f^*{}^{-1}(U)=f^{-1}(U)$ is open since $f$ is continuous.
If $\infty \in U$, then $U=(Y\setminus K)\cup \{\infty\}$ and $f^*{}^{-1}((Y\setminus K)\cup \{\infty\})=f^*{}^{-1}(Y\setminus K)\cup f^*{}^{-1}(\{\infty\})=f^{-1}(Y\setminus K)\cup\{\infty\}$.
But $f^{-1}(Y\setminus K)=X\setminus f^{-1}(K)$ and since $K$ is closed and $f$ is continuous, $f^{-1}(K)$ is also closed. Since we know that $X$ topological space implies $X^*$ compact, and closed subsets of a compact are compact, we conclude $f^{-1}(K)$ is compact and therefore $f^{-1}((Y\setminus K)\cup\{\infty\})$ is open.
So apparently there seem to be no extra conditions required, however this question (Continuity of the extension of a function between two locally compact Hausdorff spaces to their one point compactifications) suggests otherwise: It requires $X$ and $Y$ locally compact Hausdorff and $f$ proper. Could you suggest where the mistake is?
Thank you very much for your attention.