Here is a characterization that is straight from the definitions, but which it seems may be useful when verifying that a particular space has the property.
For any metric space $(X,d)$, the following are equivalent:
- For any $x\in X$ and radius $r$, the closure of the open ball of radius $r$ around $x$ is the closed ball of radius $r$.
- For any two distinct points $x,y$ in the space and any positive $\epsilon$, there is a point $z$ within $\epsilon$ of $y$, and closer to $x$ than $y$ is.
That is, for every $x\neq y$ and $\epsilon\gt 0$, there is $z$ with $d(z,y)<\epsilon$ and $d(x,z)<d(x,y)$.
Proof. If the closed ball property holds, then fix any $x,y$ with $r=d(x,y)$. Since the closure of $B_r(x)$ includes $y$, the second property follows. Conversely, if the second property holds, then if $r=d(x,y)$, then the property ensures that $y$ is in the closure of $B_r(x)$, and so the closure of the open ball includes the closed ball (and it is easy to see it does not include anything more than this, since if $g$ belongs to the closure of $B_r(x)$ then $d(x,g) \le r$ and so $g$ must also belong to the closed ball of radius $r$ centered at $x$).
QED
I had some new thoughts on this that are too long for a comment. I have a proof sketch if the space is path-connected, but it would only work if you can show that the space can't contain a Y-shaped graph.
I will use the fact that any injective map of the interval into a metric space is an embedding.
Assuming the space is path-connected, choose $x,y$ in the space, and let $\alpha$ be an arc connecting them. Let $\beta$ be a path (not necessarily an arc) from $x$ to $y$ that only intersects each endpoint once and that does not lie entirely in the image of $\alpha$ (if such a path exists). I claim that $\beta$ and $\alpha$ intersect only in their end points $x$ and $y$. Otherwise, there exists a point $p$ in the images of both $\alpha$ and $\beta$ such that there is an $\epsilon>0$ with $\beta((\beta^{-1}(p),\beta^{-1}(p)+\epsilon)$ is disjoint from $\alpha$. You choose $p$ to be the first point after $x$ where $\beta$ leaves $\alpha$.
Let $\gamma=\beta([\beta^{-1}(p),\beta^{-1}(p)+\frac{1}{2}\epsilon]$. Then $\gamma\cup\alpha$ is an embedded space with a branch point, which is not possible as discussed above.
Thus, any two paths from $x$ to $y$, each intersecting the endpoints only once, must be disjoint except in their endpoints. We can choose $\beta$ to be an arc by shrinking it; it will still be disjoint from $A$. There cannot be three such arcs, since we would get another branch point. Thus, if there are two points where two such arcs exist, the arcs must be surjective and we have a circle.
If there is only one path between each pair of points, then the space is the union of closed intervals pasted along closed intervals, and is an interval.
Edit: This is just a proof sketch; some of the details may need hammering out.
Best Answer
A space being perfect or not depends only on the topology of the space, while the closure property (the closure of the open ball $B_r(x) = \{ y : d(x,y) < r\}$ is the closed ball $K_r(x) = \{ y : d(x,y) \leqslant r\}$ for all $r \in (0,+\infty)$ and all $x \in X$) clearly depends on the metric. On every metric space $(X,d)$ with at least two points we can find an equivalent metric (i.e. a metric $d'$ inducing the same topology as $d$) such that there is at least one open ball $B_r(x)$ whose closure is a proper subset of $K_r(x)$. A uniform construction works. There always is a point $x_0 \in X$ and a $c > 0$ such that $B_c(x_0)$ is not dense in $X$, and there is a $y \in X$ with $d(x_0,y) = c$. Then taking $d'(x,y) = \min \{ c, d(x,y)\}$ works.
Hence a perfect metric space need not have the closure property.
Conversely, the closure property implies that the space is perfect if the space is not a singleton space.
This is vacuously true for the empty space. If the space contains more than one point, choose an arbitrary $x \in X$, and $y \in X \setminus \{x\}$. Let $r = d(x,y)$. Then by the closure property $x \in \overline{B_r(y)}$, hence for all $\varepsilon > 0$ we have $B_r(y) \cap B_{\varepsilon}(x) \neq \varnothing$. Since $x \notin B_r(y)$ it follows that $B_{\varepsilon}(x) \setminus \{x\} \neq \varnothing$. Hence $x \in X'$. Since $x$ was arbitrary, $X$ is perfect.
Singleton spaces aren't perfect, but they trivially have the closure property.