Here is the question:
If $X$ is a compact metric space that is totally disconnected, then for each $r > 0$ and each $x \in X,$ there is a clopen set $U$ such that $x \in U$ and $U \subseteq B_{r}(x).$
Here is the solution given in the following link Proving a property of a compact, totally disconnected metric space. :
For 1, $X - B_r(x)$ is the complement of an open set $B_r(x)$, which makes it closed. Since it is a closed subspace of a compact space $X$, it is compact too.
For 2, for any point $y \in X - B_r(x)$, you can use total disconnectedness to find disjoint open sets $U_y$ and $V_y$ such that $X = U_y \cup V_y$, and $x \in U_y$, with $y \in V_y$. These sets are complementary, and since both are open, they are both closed as well. Note that the $V_y$s cover every point $y \in X - B_r(x)$, which is compact, so a finite subcover must exist...
Are you able to finish it from there?
My questions are:
1-Is not there a typo in that $U_{y}$ and $V_{y}$ having the same subscript?
2- Also, I do not understand the general idea of the proof of "For $2.$", could anyone explain it for me, please?
The notation seems fine. As $y$ varies, $U_y$ and $V_y$ vary.
For $2$, we need to find a clopen set $U$. Proceed as given in the solution and let $\{V_i:=V_{y_i}\mid 1 \leq i\leq n\}$ be a finite subcover of $X\setminus B_r (x) $. Note that each of the $V_i$ is clopen, thus $V:=\cup_i V_i $ too. Also $ X\setminus B_r (x)\subseteq V $. Hence $X\setminus V\subseteq B_r (x) $. Again, $U:=X\setminus V$ is clopen. As each of the $U_i:=U_{y_i}=X\setminus V_{y_i}$ contains $x$, $x\in U =\cap_i U_i$.