Let $X,d$ be a metric space with non-empty subsets $A,B$, we define: $$ d(x,A):= \inf_{a \in A}d(x,a).$$
We also define the set: $$ U=\{x\in X: d(x,A) < d(x,B) \}.$$
In a sense this seems to be the set of points that are "closer" to $A$ than to $B$? (any thoughts on this, or a good way to visualise this?)
The claim is that this set $U$ is open.
So given some $x\in U$, we prove that $\exists R$, such that $B(x,R) \subseteq U$.
What would be a good way to find such an $R$? I tried it out with $R=\frac{1}{2}(d(x,A) +d(x,B))$. Observe that for $y\in B(x,R)=\{b \in X | d(b,x) <R\}$ we have: $$ d(y, A) \leq d(y,x) + d(x,A) $$ By the triangle inequality (proven in an earlier exercise for this distance function). We then take the property from $U$ that says $d(x,A) < d(x,B)$ and get: $$ d(y, A) < d(y,x) + d(x,B)< R + d(x,B)= \frac{1}{2} d (x,A) + \frac{3}{2} d(x,B) \dots $$ And as you can see I got kind of stuck. I am a far way from proving $d(y,A) < d(y,B)$ it seems.
Here is an argument just using the triangle inequality.
Suppose that $d(x,A)<d(x,B)$, let $\epsilon=\frac13\big(d(x,B)-d(x,A)\big)$ and suppose that $d(x,y)<\epsilon$. Then for each $b\in B$ we have $d(x,b)\le d(x,y)+d(y,b)$ and hence
$$d(y,b)\ge d(x,b)-d(x,y)>d(x,B)-\epsilon\,,$$
so that $d(y,B)\ge d(x,B)-\epsilon$.
There is an $a\in A$ such that $d(x,a)<d(x,A)+\epsilon$, and for that $a$ we have
$$d(y,a)\le d(y,x)+d(x,a)<d(x,A)+2\epsilon\,,$$
so $d(y,A)<d(x,A)+2\epsilon$.
Thus,
$$\begin{align*} d(y,B)-d(y,A)&>d(x,B)-\epsilon-\big(d(x,A)+2\epsilon\big)\\ &=d(x,B)-d(x,A)-3\epsilon\\ &=0\,, \end{align*}$$
and $y\in U$. In other words, the $\epsilon$-ball centred at $x$ is contained in $U$, and $U$ is open.