Problem: Let $(X, \mathcal{T} )$ be a topological space and $A \subseteq X$. Let $\partial A$ be the boundary of $A$. Show that
\[
\partial A = \emptyset \iff A \text{ is both open and closed in } X.
\]
Use the fact that $\partial A = \bar{A} \cap \overline{X \setminus A}$.
A point $x \in \partial A$, then every neighbourhood $U_x \subseteq X$ of $x$, $U_x \cap A \neq \emptyset $ and $U_x \cap (X\setminus A) \neq \emptyset $. Equivalently, the set has $A$ empty boundary means $$\forall\ x\in X, \quad \exists\ U_x \subseteq X \text{ such that } U_x \cap A = \emptyset \text{ or } U_x \cap (X\setminus A) = \emptyset$$
Solution: Let $A$ be both open and closed in $X$. Since $A$ is closed, $\bar{A} = A$ and as $A$ is open, the complement is closed and hence $\overline{X\setminus A} = X\setminus A$. Then the boundary of $A$ is given by
\begin{align*}
\partial A & = \overline{A} \cap \overline{X\setminus A} \\
& = A \cap (X\setminus A) \\
& = \emptyset.
\end{align*}
On the other hand, let $\partial A = \emptyset $. Recall that if $x \in \partial A$, then every neighbourhood $U_x \subseteq X$ of $x$, $U_x \cap A \neq \emptyset $ and $U_x \cap (X\setminus A) \neq \emptyset $. Since $\partial A = \emptyset $,
\begin{align*}
& \forall\ x\in X, \quad \exists\ U_x \subseteq X \text{ such that } U_x \cap A = \emptyset \text{ or } U_x \cap (X\setminus A) = \emptyset \\
\implies & \forall\ x\in A, \quad \exists\ U_x \subseteq X \text{ such that } U_x \cap (X\setminus A) = \emptyset \\
\implies & A \text{ is open in } X.
\end{align*}
Similarly, we can show that $X\setminus A$ is open and hence $A$ is closed in $X$. Therefore, $A$ is both open and closed in $X$.