In general, the result doesn't hold. For example $f: \mathbb{R} \to \mathbb{R}^2$ with $f(x)=(x,0)$ [Euclidian Norm].
Now my attempt to prove the restricted case goes as follows:
Let $V \subset X$ be open. Then $\forall p \in V$, $\exists$ some $\delta >0$, s.t. $d(x,p)< \delta \implies x\in V$. Now, $d(x,p)=d(f(x), f(p)) <\delta$, and $x,p \in V \implies f(p), f(x) \in f(V)$. Hence, $f(B_d(p,\delta)) \subseteq B_d(f(p),\delta)$
I am unable to prove the other inclusion. We could use the fact "every isometry of a compact metric space into itself is onto", but I am trying to prove it independently.
Thank you.
Is $(X, d)$ complete? If so, I am trying the following. (And if it is not necessarily completely, the following may indicate a counterexample.)
If $A$ is a closed set in $(X, d)$, let $b$ be a limit point of $f(A)$. Thus, $A$ contains a sequence $\{a_{n}\}_{n}$ such that $\{f(a_{n})\}_{n}$ converges to $b$. Our proof will be done when we show that $b \in f(A)$.
Being convergent, the sequence $\{f(a_{n})\}_{n}$ is Cauchy. Therefore, so is $\{a_{n}\}_{n}$. Therefore, $\{a_{n}\}_{n}$ converges (because the metric space is complete) to some $a \in X$. And since $A$ is closed, $a$ must lie in $A$.
Finally, being an isometry, $f$ is continuous, so $$ b = f(a) \in f(A). $$