A continuous injective function and its inverse

In my course on mathematical analysis there's a theorem that states:

Proposition: Let $A$ be a closed bounded subset of $\mathbb{R}$. Suppose $f: A \rightarrow \mathbb{R}$ is a continuous injective function. Then $f^{-1} : f(A) \rightarrow A$ is also continuous.

As an example, consider the function $$f: [0,2] \setminus \left\{1\right\} \rightarrow [0, 2): x \mapsto \begin{cases} x & 0 \leq x < 1 \\ 3-x & 1 < x \leq 2 \end{cases}.$$ On the basis of the graph we see clearly this function is injective and continuous in all the points in the domain where it is defined. But the inverse $f^{-1} : [0, 2) \rightarrow [0, 2] \setminus \left\{1\right\}$ is not continuous in $1$. The problem is that the proposition is not satisfied, since the set $A = [0, 2 ] \setminus \left\{1\right\}$ is bounded but not closed.

Now, I was trying to come up with a continuous injective function $f : A \rightarrow \mathbb{R}$ with $A$ a closed but not bounded subset of $\mathbb{R}$, such that the inverse $f^{-1}$ is then not continuous. I was thinking of letting $A = \mathbb{N}$, since $\mathbb{N}$ is closed. I think for the function $f$ to be injective, it has to be strictly monotone. But I'm having trouble with figuring out an example that illustrates this. Anyone has any ideas?

• You only need monotonicity for injectiveness if the domain is connected. Since $\mathbb{N}$ is not connected, a continuous injective function $f\colon \mathbb{N}\to\mathbb{R}$ need not be monotonic. Try something with $f(0) = 0$ to get a continuous injective function whose inverse is not continuous at $0$. – Daniel Fischer Feb 21 '16 at 12:32