If $f^{-1}(B)$ is compact for all compact $B$, then $f(A)$ is closed for all closed $A$ How to prove this exercise? 

Let $f$ be a continuous function of $\mathbb R^n$ to $\mathbb R^m$, so that $f^{-1}(B)$ is compact in $\mathbb R^n$ for all compact $B$ in $\mathbb R^m$. Prove that $f(A)$ is a closed set in $\mathbb R^m$ for all closed set $A$  in $\mathbb R^n$.

 A: The question has since been changed. The next two paragraphs are no longer relevant. 

The continuous image of a compact set is compact regardless of your additional property. 
The proof is the following. Suppose $\mathcal{C}$ is a covering of $f(A)$ by open sets. Then $f^{-1}(X)$ for any $X \in \mathcal{C}$ is open, since $f$ is continuous. Thus the inverse image of every open set in $\mathcal{A}$ is an open covering of $A$. Since $A$ is compact, a finite number of these cover $A$. Thus a finite number of the original covering cover $f(A)$. 

In light of the comments, the question has been phrased incorrect. Given a continuous function with the properties stated in the question, I will prove that $f$ is a closed map. Note I am proving that a proper map between euclidean space is a closed map. 
Let $A$ be closed. Let $x$ be a limit point of $f(A)$. Since we are in $\mathbb{R}^m$, we can choose a ball $U$ around $x$ such that its closure $\bar{U}$ is compact. Therefore, $f^{-1}(\bar{U})$ is compact. Compact subsets of euclidean space are closed. Therefore $A \cap f^{-1}(\bar{U})$ is compact since close subsets of compact sets are compact. As mentioned above, continuous image of compact sets are compact. Therefore, $f(A \cap f^{-1}(\bar{U}))$ is compact and hence closed in $\mathbb{R}^m$. Let $Z = f(A \cap f^{-1}(\bar{U}))$. Therefore, $Z$ is closed. $x$ is a limit point of f(A) and $\bar{U}$ contains $x$, so x is a limit point of $Z$. Since, $Z$ is closed, $x \in Z \subset f(A)$. Thus $x \in f(A)$. $f(A)$ contains all its limits point; hence, it is closed. 
A: You only need continuity of f; f continuous sends compact sets to compact sets.
A: Suppose $A$ is closed and that we have a Cauchy sequence $y_n\in f(A)$, it suffices to show that $y_n$ converges to a point of $f(A)$ (in order to prove that $f(A)$ is closed).
Hint: 


*

*Show that there is a Cauchy sequence $x_n\in A$ such that $f(x_n)=y_n$.

*What can we say about $f(\lim x_n)$?
