compactness property  I am a new user in Math Stack Exchange. I don't know how to solve part of this problem, so I hope that one of the users can give me a hand.
Let $f$ be a continuous function from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$ with the following properties:$A\subset \mathbb{R}^{n}$ is open then $f(A)$ is open. If $B\subset \mathbb{R}^{m}$ is compact then $f^{-1}(B)$ is compact.
I want to prove that $f( \mathbb{R}^{n}) $ is closed.
 A: I’ve left some of the details to you, but here’s the main outline.
Suppose that $f[\Bbb R^n]$ is not closed in $\Bbb R^m$. Then there is a point $p\in\operatorname{cl}f[\Bbb R^n]\setminus f[\Bbb R^n]$, and there is a sequence $\langle x_n:n\in\Bbb N\rangle$ in $f[\Bbb R^n]$ converging to $p$. Let $K=\{p\}\cup\{x_n:n\in\Bbb N\}$, and show first that $K$ is compact, so that $f^{-1}[K]$ is compact in $\Bbb R^n$. Now for each $n\in\Bbb N$ choose $y_n\in f^{-1}[K]$ such that $f(y_n)=x_n$, and consider the sequence $\langle y_n:n\in\Bbb N\rangle$. This is a sequence in the compact set $f^{-1}[K]$, so it has a convergent subsequence $\langle y_{n_k}:k\in\Bbb N\rangle$, say with limit $y$. What must $f(y)$ be? Why is this a contradiction?
A: Try another approach; show that the complement of $f(\mathbb{R}^n)$ is open.
This is trivial if the complement is empty, so suppose the complement is not empty, and choose $\hat y \notin f(\mathbb{R}^n)$. You want to show that there exists some $\epsilon>0$ such that the set $B(\hat y, \epsilon)$ also lies in the complement.
You can proceed by contradiction and generate a sequence of points  $y_k \in f(\mathbb{R}^n)$ that converge to $\hat y$.
Now consider the set $\{y_k\} \cup \{\hat y\}$. What properties does it have in relation to the second property above, and how does this lead to a contradiction?
A: Take $y \in \overline{f(\mathbb{R}^n)}$.
Let $B_\varepsilon = \{x | d(x,y) \leq \varepsilon\}$.
Now,
$\emptyset \neq B_\varepsilon \cap f(\mathbb{R}^n) = f\left(f^{-1}(B_\varepsilon)\right)$.
Because $f^{-1}(B_\varepsilon)$ is compact, $B_\varepsilon \cap f(\mathbb{R}^n)$,
as the image of a compact by $f$, is a decreasing sequence of nonempty compact sets.
Therefore,
$\bigcap_\varepsilon (B_\varepsilon \cap f(\mathbb{R}^n))$ is nonempty.
Now,
$\emptyset \neq \bigcap_\varepsilon (B_\varepsilon \cap f(\mathbb{R}^n))
\subset
\bigcap_\varepsilon B_\varepsilon = \{y\}$
implies that $y \in f(\mathbb{R}^n)$.
That is, $f(\mathbb{R}^n) = \overline{f(\mathbb{R}^n)}$.
By the way, the only "clopen" sets in $\mathbb{R}^m$ are $\emptyset$ and
$\mathbb{R}^m$. Since $f(\mathbb{R}^n)$ is not empty, we have that
$f(\mathbb{R}^n) = \mathbb{R}^m$.
A: I think that the most instructive proof is that of Proposition 5.3 of this file. Indeed, it shows that proper maps between locally compact topological spaces are always closed. This is a generalization of this discussion. I find it interesting since "standard" proofs tend to use sequences, and one might believe that everything might be lost without a metric.
By the way, a very nice corollary of the proposed exercise is that non-constant maps with the two properties are always surjective, since $f(\mathbb{R}^n)$ is connected.
