Let $X,Y$ be Hausdorff and locally compact topological spaces, with $Y$ not compact, and let $\hat{Y}$ be the Alexandroff compactification of $Y$. Let $A\subset X$ be an open, relatively compact subset of $X$ and consider a map $f:A\to Y$. Denote by $\hat f:X\to \hat Y$ the extension of $f$ defined as follows:
\begin{equation*} \hat f(X-A)=\infty \end{equation*} (while, if $x\in A$, $\hat f(x)=f(x)$).
Show that $\hat f$ is continuous if and only if $f$ is continuous and proper, that is:
\begin{equation*} K\subset Y\text{ compact }\Longrightarrow f^{-1}(K)\subset A \text{ compact} \end{equation*}
I have proved that if $\hat f$ is continuous, then $f$ is continuous too. However, I am having some troubles showing that $f$ is also proper: if $K\subset Y$ is compact, then, since $Y$ is Hausdorff, $K$ is closed in $Y$.. Since $f$ is continuous, $f^{-1}(K)\subset A$ is closed in $A$. Now, if $f^{-1}(A)$ were closed also in $\overline{A}$, I could conclude that $f^{-1}(K)$ is compact, because it would be closed in a compact set. However, since $A$ is an open subset of $X$, then $A$ is open in its closure, because: \begin{equation*} A=\overline{A}\cap A \end{equation*} So, $f^{-1}(K)$ closed in $A$ does not necessarily implies that $f^{-1}(K)$ is closed in $\overline{A}$ too (the implication would be true if $A$ were closed in its closure).
Do you have any suggestion?
Thanks for any help!