Problem: Consider the set $A = \{ 0 \} \cup \left[ \frac{1}{2} ,1\right] .$ Let $A$ is equipped with the subspace topology of $\mathbb{R} $. Show that $\{ 0 \} $ is open as well as closed in $A$.
Solution: We recall that if $\mathcal{T} $ is the topology on $\mathbb{R} $, then the subspace topology on $A$ is defined as
\begin{align*}
\mathcal{T} _A = \left\{ A \cap U: U \in \mathcal{T} \right\} .
\end{align*}
Let us show that $\{ 0 \} $ is open in $A$, that is, $\{ 0 \} \in \mathcal{T} _A $. Note that
\begin{align*}
\{ 0 \} = A \cap \left( -\frac{1}{3}, \frac{1}{3} \right) \implies \{ 0 \} \in \mathcal{T} _A.
\end{align*}
Now note that,
\begin{align*}
\left[ \frac{1}{2},1 \right] = A \cap \left( \frac{1}{3},2 \right) \implies \left[ \frac{1}{2},1 \right] \in \mathcal{T} _A.
\end{align*}
Since
\[
\{ 0 \} = A \setminus \left[ \frac{1}{2},1 \right] \implies \{ 0 \} \text{ is closed in } A.
\]