open vs closed vs continuous between subsets of $\mathbb{R}$

I'm trying to figure out a series of examples. I want them the simplest possible.

1. open and closed and continuous: $f: \mathbb{R} \rightarrow \mathbb{R}$, $f(x) = x$

1. continuous but not open and not closed: $f: \mathbb{R} \rightarrow \mathbb{R}$, $f(x) = \frac{1}{1+x^2}$
• because $\mathbb{R}$ which is both open and closed maps to $]0;1]$ which is neither

1. continuous and closed but not open: $f: \mathbb{R} \rightarrow \mathbb{R}$, $f(x) = x^2$
• because $\mathbb{R}$ maps to $[0; +\infty[$ which is closed but not open

1. continuous and open but not closed: $f: \mathbb{R} \rightarrow \mathbb{R}$, $f(x) = arctan(x)$
• because $\mathbb{R}$ maps to $]-\frac{\pi}{2};\frac{\pi}{2}[$ which is open and not closed

1. Not Continuous, Not open, Closed: $f: \mathbb{R} \rightarrow \mathbb{R}$

$$f(x) = \begin{cases} 0, & \text{if x \lt 0 } \\ 1+x, & \text{if x \ge 0 } \end{cases}$$

• because images of open neighborhoods of $0$ will not be open

1. Not Continuous, Not open, not Closed: $$f(x) = \begin{cases} x, & \text{if x \lt 0 } \\ 1+x, & \text{if x \ge 0 } \end{cases}$$

• because images of open/closed neighborhoods of $0$ will not be open/closed

Question: I'm missing two examples, I have the feeling open functions from $\mathbb{R} \rightarrow \mathbb{R}$, will be continuous and injective ?

Indeed, assuming $f$ is not left continuous at a single point in $]a;b[$, There will always be some neighborhood of discontinuity such that:

• $]a;b[$ maps to $]f(a);x[ \cup [y;f(b)[$

And continuous open functions have to be injective? Otherwise an open neighborhood of the singularity need not to be open as in $x \rightarrow x^2$

EDIT: I of course am always using the euclidean topology all along.

• I believe that your examples 1,2,3,4 are correct but the presented argument is incomplete. E.g. in 4, in order to show that $f$ is open you need to show that the image of every open set is open. In 5,6 it is not clear how you define $f$ for positive $x$ that are not odd integers. – Mirko Dec 12 '15 at 20:02
• Of course. I was not stating the obvious, only the specific open/close sets for which the distinction occurs. I was not meant to be a detailed proof :) – user2346536 Dec 12 '15 at 20:07
• Regarding 5/6 it was bascially a bad copy paste of mathjax.... which I'm sorry about – user2346536 Dec 12 '15 at 20:08
• Thanks for showing my bad copy paste, hence the vote. – user2346536 Dec 12 '15 at 21:14

Lemma : A continuous function $f : \mathbb{R} \rightarrow \mathbb{R}$ is open if and only if it is injective.

Proof :

• If $f$ is not injective, then there exists $a, b$ with $$f(a) = f(b) = r$$ for some $r \in \mathbb{R}$ and $a < b$. But since $f$ is continuous $f\big([a, b]\big)$ is compact and connected, and so must be an interval $[c, d]$. If $c = d$, then $f\big((a, b)\big) = {c}$. Otherwise, $$[c, d] ~\supseteq~ f\big((a, b)\big) ~\supseteq~ f\big([a, b]\big) - {r} ~=~ [c, d] - {r}.$$ Both possibilities are not open, so $f$ cannot be open.
• Conversely, if $f$ is injective, then $f$ must be monotonic (i.e. strictly increasing or strictly decreasing). For if $a < b < c$, the intermediate value theorem says that every value between $f(a)$ and $f(b)$ is taken on by some $x \in [a, b]$, so none of them is $f(c)$. Assume that $f(a) < f(b)$. Then $f(c) < f(a)$ or $f(b) < f(c)$. But $f(a)$ can not lie between $f(b)$ and $f(c)$ either, for some $x \in [b, c]$ would have $f(x) = f(a)$ if it did. Hence $$f(a) < f(b) < f(c),$$ and the function is increasing. The case for $f(a) > f(b)$ can be shown by applying this case to $-f$. Since an injective $f$ is also monotone, $$f\big((a, b)\big) ~=~ \begin{cases}\big(f(a), f(b)\big); \\ \big(f(b), f(a)\big).\end{cases}$$ In either case, it is an open set. This is sufficient to show that $f$ is an open function.

Corollary : An open injective function is continuous.

Proof : $f^{-1}$ is also an injective function, and is continuous since $f$ is open. Hence $f^{-1}$ is open, and so $f$ is continuous.

Moral : The following 3 cases are impossible:

• $f: \mathbb{R}\rightarrow \mathbb{R}$ continuous, open, not injective;
• $f: \mathbb{R}\rightarrow \mathbb{R}$ continuous, not open, injective;
• $f: \mathbb{R}\rightarrow \mathbb{R}$ not continuous, open, injective.

A function $f : \mathbb{R} \rightarrow \mathbb{R}$ that is open but neither continuous nor closed : See Example 17 on page 168 of "Counterexamples in Analysis" by Bernard R. Gelbaum and John M. H. Olmsted. The construction is described on page 104 (Example 27).

• Voted but still this is partial. I believe my two last examples cannot be found because open (alone) will imply continuous. Note: (strictly increasing, increasing ) is french, (increasing, non-decreasing) I guess is better. Same as for positive/non negative. I often get confused with that too... – user2346536 Dec 12 '15 at 21:10
• Not continuous, Open, Closed is the last remaining case. I'm afraid I can't come up with anything so far. – M.G Dec 12 '15 at 23:46

I've just found an example of an open discontinuous function from $\mathbb{R}$ to $\mathbb{R}$, hence answering my question:

http://mathforum.org/library/drmath/view/62395.html

[This is the weird-most I ever met... I would like to copy the whole answer here in case it disappear from the other forum. Is it ok to to that in term of copyrights and all ?]