Does continuity of $f$ imply $f^{-1}(\bar A)\subset\overline{f^{-1}(A)}$?
Solution 1:
Let $Y = \mathbb{R}$ with usual metric and $X = (0,1) \cup \{2\}$ with metric inherited from the standard metric on $\mathbb{R}$. let $f(x) = x$ on $(0,1)$ and $f(2) = 1$ and take $A = (0,1)$. it is then easy to see that for this particular case your statement doesn't hold
Solution 2:
Since $A\subseteq\bar{A}$ you know that $f^{-1}(A)\subseteq f^{-1}(\bar{A})$, so $$ \overline{f^{-1}(A)}\subseteq f^{-1}(\bar{A}) $$ because $f^{-1}(\bar{A})$ is closed by continuity of $f$.
Now, if your claim is true, you'd conclude that $\overline{f^{-1}(A)}= f^{-1}(\bar{A})$ for every $A\subseteq Y$. Can you?
Solution 3:
Let $X=\mathbb{R}$ with the discrete metric. Then any function is continuous. Let $Y=\mathbb{R}$ with the standard metric. Define $f:X\rightarrow Y$ to be $f(1)=1$ and $f(x)=\sqrt{2}$ for all $x\neq 1$. Finally set $A=\mathbb{Q}$. Then $\overline{\mathbb{Q}}=\mathbb{R}$ and $f^{-1}(\mathbb{R})=\mathbb{R}$. But, $f^{-1}(\mathbb{Q})=\{1\}$.