An example of open but not closed map. 
Exercise: Find an example of mapping which is open but not closed, which is closed but not open.

I am thinking of trivial examples with $X=\{1,2,3\}$ however I have no idea on how to build a function that preserves the open interval but no the closed ones. Since this is my first exercise of this kind.
Question:
Can someone give me a hint?
Thanks in advance!
 A: Consider the projection mapping  $f:\Bbb R^2\to \Bbb R$ defined as  $f(x_1,x_2)=x_1$. $f $ is continuous and open, but not closed. (Consider the image of the hyperbola  $x_1x_2=1$ under $f $.)
A: Starting with the simplest example of maps from $\mathbb R$ into itself, which are the constant maps, would be a good idea.
On the other hand, if $f$ is a map from $\mathbb R$ into itself, and if its image is a subset of $\mathbb R$ which is not closed, then $f$ cannot possibly be a closed map.
A: Hint: Consider the inclusion functions $U \hookrightarrow \mathbb{R}$ for suitable subsets $U$ of $\mathbb{R}$, giving $\mathbb{R}$ its usual Euclidean topology, but giving $U$ the indiscrete (trivial) topology.
What happens if $U$ is open but not closed in $\mathbb{R}$? What happens if $U$ is closed but not open in $\mathbb{R}$?
A: Any constant function $f:\mathbb{R} \to \mathbb{R}$ is closed but not open. For an open but not closed map, let $g:\mathbb{R} \to\mathbb{R}$ denote the Conway Base 13 function—a pathological function which maps all nonempty open sets to $\mathbb{R}$—and compose it with any map $f:\mathbb{R} \to \mathbb{R}$ whose image is precisely $(0,1)$. The resultant function is open because all nonempty open sets are mapped to $(0,1)$, but not closed because, for instance, the image of $[0,1]$ is $(0,1)$ which is not closed in $\mathbb{R}$. 
