Suppose that $A \neq \mathbb{R}$, then there is a point $y \in \mathbb{R}$ such that $y \not\in A$. Since $A$ is closed, this means that $\mathbb{R}\setminus A$ is open. Moreover, $\mathbb{R} \setminus A$ is also closed, since $A$ is open.
Suppose without loss of generality that the set $A_{< y} = \{ a \in A : a < y \}$ is not empty. Let $x = \sup A_{<y}$. We know that $x \in A$ since $A$ is closed. Given $\delta > 0$, what can we say about $B_\delta(x)$?
Since $y \in \mathbb{R}\setminus A$, there is an $\epsilon > 0$ such that $(y - \epsilon, y + \epsilon)$ is disjoint from $A$. This means that $x < y$. Now for any $\delta >0$ the interval $(x-\delta, x+\delta)$ contains numbers larger than $x$ but less than $y$. By our definition, $x$ is the largest real number in $A$ less than $y$, and therefore $(x-\delta, x+ \delta)$ is not contained in $A$ for any $\delta>0$. Therefore $A$ is not open, and this is a contradiction.