A bijective mapping between metric spaces is open iff it is closed Let $X$ and $D$ be metric spaces and suppose that $f: X \to D$ is one-one and onto. Show that $f$ is an open map iff $f$ is a closed map.

how can I able to solve this problem
 A: Hint: Since the map is one-to-one and onto, it respects complements: for all subsets $A \subset X$, $f(X \setminus A) = 
D \setminus f(A)$.     
A: In fact, $f : X \to D$ is bijective iff $f(X \backslash A)=D \backslash f(A)$ for every $A \subset X$.
Indeed, if $f$ is injective, $f(X \backslash A)=f(X) \backslash f(A)$, and if $f$ is surjective, $f(X)=D$, hence $f(X \backslash A)=D \backslash f(A)$. For the converse, for $A= \emptyset$, you get $f(X)=D$ so $f$ is surjective; if $x \neq y \in X$, then $f(x) \in f(X \backslash \{y\})=D \backslash \{f(y)\}$ so $f(x) \neq f(y)$: $f$ is injective.
If you only suppose that $f(X \backslash A)=D \backslash f(A)$ for every open set $A \subset X$, the result depends on the topology on $X$. However, since $\emptyset$ and $X$ are always open, $f$ is necessarly surjective.
Of course, $f$ is still bijective for the discrete topology. But for the trivial topology, you only have $f(X)=D$ so $f$ only needs to be surjective.
A: $=>.$ Suppose $f$ a open map. For your bijective, we have $X$ open $\Rightarrow$ $f(X)=D$ open. Take a $F\subset X$ closed. Then $X\setminus F=A$ is open. We must show that $f(F)$ is closed. Sise $f$ is one-one and onto, then $f(A\cup F)=f(A)\cup f(F)=D\Rightarrow f(A)=D\setminus f(F).$ Since $f(A)$ is open we have $f(F)$ closed and so $f$ is an open map.
$\Leftarrow$ Take $A\subset X$ open and suppose $f$ closed map. Then $f(X)=D$ closed every that $X$ closed. Sinse $A$ is open, we have that $\forall x\in A\exists \epsilon>0;B(x,\epsilon)\subset A.$ Sinse $f$ one-one and onto, implids that $\forall f(x)\in A$ we have $B(f(x),\epsilon)\subset f(A)$. Therefore $f(A)$ is open and $f$ is open map.
(Sorry for my bad english)
