[Math] example of a non-continuous function that is open and not closed

analysisgeneral-topologymultivariable-calculus

Can you help me find an example of a function from a subset of $\mathbb{R}^2$ to a subset of $\mathbb{R}^2$ that is not continuous nor closed, but open? and another one that is not continuous but both open and closed? I could only find one that is not continuous nor open but closed.
Thank you.

Best Answer

Let $$X = \{(x,0):x\in\mathbb{R}\}\cup\{(x,1/n):x \in \mathbb{R}\text{ and }n\in\mathbb{Z}^+\},$$ and let $$Y = \{(x,n)\in\mathbb{R}^2: n\in \mathbb{N}\},$$ where $\mathbb{N}$ is the set of non-negative integers. There’s a pretty natural map from $X$ onto $Y$ that is open and closed but not continuous; can you find it?

Now let $X = [0,1]$ and define $f:X\to X$ by $$f(x) = \begin{cases}2x,&\text{if }0 \le x \le 1/2\\ x,&\text{if }1/2 < x \le 1; \end{cases}$$

$f$ is clearly not continuous, and it’s not too hard to show that it’s open but not closed.