Prove that a function from a metric space X into the metric space Y is continuous. $\def\bdy{\operatorname{bdy}}\def\interior{\operatorname{int}}$(1) 
Prove that a function from a metric space X into the metric space Y is continuous if and only if for each $$A \subset X , f(\bar A) \subset \overline {f(A)} .$$
(2) Prove that if $f$ is a one to one mapping from the metric space X into the metric space Y, show that $f$ is a homeomorphism if and only if, for each $$A \subset X, f(\bar A)=\overline {f(A)}.$$
Attempt at one.  $\bar A=\interior(A) \cup \bdy A$. So x $\in A$ then $f(x) \in f(\bar A)$ also $f(x) \in \overline {f(A)}$. 
If $ x \in \bdy A$ then $f(x) \in f(\bar A)$ like wise $f(x) \in \overline {f(A)}$.  But $$f(\bar A)=f(A) \cup f(\bdy A) $$ $f(\bar A) $maybe a open set where $\overline {f(A)}$ is a closed set containing the $$\bdy f(A) \cup f(A).$$ Now $\bdy f(\bar A) \not= \bdy\overline {f(A)}$ because $f(\bar A)$may be an open set in Y. 
Where as $\overline {f(A)}$ is closed so it contains all boundary points. Do not really have a clue how to do the converse.
Attempt at 2: Since $f$ is one to one and a homeomorphism we know that for every $f(a) \in f( A) $ are distinct so we need only to show that $$\bdy f(A)=f(\bdy A).$$  Not quite sure how do prove that and also not sure how to prove converse.
 A: (1) I can't quite follow what you're trying to do here. I would suggest instead looking at the sequential characterization of continuity for metric spaces. That is a function $f: X \rightarrow Y$ is continuous if and only if for every sequence $x_n \rightarrow x$ we have $f(x_n) \rightarrow f(x)$. 
(2) This question needs a bit of tweaking. Either the assumptions should include that $f$ is onto or the problem should be to show that $f$ is an embedding. Regardless the idea here is to use apply (1) to $f$ and $f^{-1}$ to get your desired result. 
A: *

*If $f$ is continuous then $f(\bar A)\subset\overline{f(A)}$ for all $A\subset X$: Remember that if $B$ is any set then $x\in\bar B$ if and only if for every open nbhd $U$ of $x$, $U\cap B\ne\emptyset$. So, let $y\in f(\bar A)$. To show that $y\in\overline{f(A)}$, let $V$ be an open nbhd of $y$. Now there exists some $x\in\bar A$ such that $y=f(x)$ and, since $f$ is continuous, $f^{-1}(V)$ is an open nbhd of $x$. Can you finish from here?

*If $f(\bar A)\subset\overline{f(A)}$ for every $A\subset X$ then $f$ is continuous: To show that $f$ is continuous, we only need to show that the preimage of every closed set is closed. So, let $F\subset Y$ be closed. Now it's enough to show that $\overline{f^{-1}(F)}\subset f^{-1}(F)$. From the given property of $f$ we get that 
$$f\left(\overline{f^{-1}(F)}\right)\subset\overline{f(f^{-1}(F))}\subset\overline F=F.$$
Therefore, since $B\subset f^{-1}(f(B))$ for all $B$, we have
$$\overline{f^{-1}(F)}\subset f^{-1}\left(f\left(\overline{f^{-1}(F)}\right)\right)\subset f^{-1}(F).$$

*If $f$ is one to one and onto, and $f(\bar A)=\overline{f(A)}$ for every $A\subset X$, then $f$ is a homeomorphism: Now $f(\bar A)\subset\overline{f(A)}$ for every $A\subset X$ so, by (2), $f$ is continuous. On the other hand if $B\subset Y$ then using the fact that $f$ is one to one and onto,
$$\bar B=\overline{f(f^{-1}(B))}=f\left(\overline{f^{-1}(B)}\right)$$
and hence
$$f^{-1}(\bar B)=\overline{f^{-1}(B)}.$$
By (2) the function $f^{-1}$ is also continuous.

*If $f$ is a homeomorphism then $f(\bar A)=\overline{f(A)}$ for every $A\subset X$: The idea here is similar to (3) but this time use (1) instead of (2).


As a side note, this works for all topological spaces, not just metric ones.
