[solution]
**Step 1 (Define the maximal radius).** Since $U$ is open and $x \in U$, there exists $r_0 > 0$ with $B(x, r_0) \subseteq U$. Define
\begin{align*}
\varepsilon := \sup\{r > 0 : B(x, r) \subseteq U\}.
\end{align*}
This supremum exists in $(0, \infty]$ because the set $\{r > 0 : B(x, r) \subseteq U\}$ is nonempty (it contains $r_0$).
**Step 2 (Prove $B(x, \varepsilon) \subseteq U$).** Let $y \in B(x, \varepsilon)$, so $d(x, y) < \varepsilon$. Choose $r$ with $d(x, y) < r < \varepsilon$. By the definition of supremum, $r \in \{s > 0 : B(x, s) \subseteq U\}$ (since $r < \varepsilon = \sup$, there exists $s > r$ with $B(x, s) \subseteq U$, and $B(x, r) \subseteq B(x, s) \subseteq U$). Therefore $y \in B(x, r) \subseteq U$.
**Step 3 (Maximality).** If $B(x, R) \subseteq U$ for some $R > 0$, then $R \in \{r > 0 : B(x, r) \subseteq U\}$, so $R \le \varepsilon$ by definition of supremum. Therefore $B(x, R) \subseteq B(x, \varepsilon)$, and $B(x, \varepsilon)$ is the largest open ball centred at $x$ contained in $U$.
**Step 4 (The ball at radius $\varepsilon$ is not necessarily in $U$ when $\varepsilon < \infty$).** The supremum need not be attained: consider $U = (0, 2) \subset \mathbb{R}$ and $x = 1$. Then $\varepsilon = 1$ and $B(1, 1) = (0, 2) = U \subseteq U$. But for $U = (0, 2)$ and $x = 1/2$, we get $\varepsilon = 1/2$ and $B(1/2, 1/2) = (0, 1) \subseteq U$. Here $B(x, \varepsilon) \subsetneq U$, and the closed ball $\overline{B}(x, \varepsilon) = [0, 1] \not\subseteq U$. $\blacksquare$
[/solution]