I'm trying to prove what seems an elementary general topology exercise (I'm trying to prove it in order to use it in a basic complex analysis course) It's the following property:
Let $(X,d)$ be a metric space, let $G\subset X$ be an open but not closed subset of $X$ and $x\in G$. Denoting, for each $r>0$, the open ball $B(x,r):=\{y\in X\mid d(x,y)<δ\}$, we define
$R=\sup\{r>0\mid B(x,r)\subset G\}\\ D= \operatorname{dist}(\{x\},\partial G) \quad \text{(Since $G$ is not clopen, it's $\partial G \ne \varnothing$})\\ (\text{where for each }A, B\subset X \text{ we define } \operatorname{dist}(A,B):=\inf\{d(a,b)\mid a\in A, b \in B\}). $
Then, $R=D$.
So far I've managed to prove that $R\leq D$:
Suppose $D<R$. Then it exists some $δ>0$ s.t. $D<δ<R$ and therefore $B(x,δ)\subset G$. It's not difficult to see that, since $D<δ$, it's going to be $B(x,δ)\cap \partial G\ne\varnothing$. But this contradicts the fact that $G\cap\partial G = \varnothing$ for every open but no clopen set $G$. Therefore, $R\le D$.
But I'm having trouble trying to prove that $D\leq R$. I think the proof would have to do with examining what happens at the boundary of $\overline{B}(x,R)$, but I'm not sure even if the whole statement is false, since I'm starting to suspect that maybe we need more hypothesis in order to make it true (the statement feels very intuitive in $\mathbb{R}^2$, for example).
Any thoughts on the problem?
Edit: Since I've received an answer which provides a counterexample for the $D\le R$ part (the one by Snake707), the statement has been proven false and therefore the only thing we can assure in metric spaces is that $R\le D$. I guess the question now is: When is also $D \le R$ true and therefore $D=R$? Are there some sufficient or necessary conditions over the particular space which is $X$ in order to make the statement true? (maybe asking for connectivity or requiring that $X$ is Banach or some type of space where all balls are connected, since as I said in $\mathbb{R}^2$ is intuitive that is going to be true. I don't know now).
As soon as I end my exam period, I'll come back to this problem again to try if I can decide something over it. In the meantime, let's see if there's somebody who can give a satisfactory answer before that.
Edited. I believe you need slightly more assumptions for your assertion. Consider a the space $]-3, -1[ \cup ]1, 3[ = X$ equipped with the metric from $\mathbb{R}$. Let $x=-2$ and $G = ]-3, -1[ \cup ]2, 3[$. Then $\partial G = \{2\}$.
Your value $D$ is $4$. Your value $R$ is $3$ thus $R < D$.