About open set in extended real line With the metric structure:for all $x,y \in \mathbb{R}$ $$d(x,y)=|\tan^{-1}x-\tan^{-1}y|$$
$$d(\infty,x) = |\pi/2-\tan^{-1}x|$$ $$d(-\infty,x) = |\pi/2+\tan^{-1}x|$$
1: Are $(a,\infty]$ and $[-\infty,a)$ for all $a\in \mathbb{R}$ and open set? 
2: I was told that every open set in $\bar{R}$ can be written as the countable union of intervals of the form $(a,b),\;(a,\infty],[-\infty,a)$. But how? (I know how an open set in $\mathbb{R}$ can be written as a countable union of open intervals) 
I know this question is a little bit elementary, but it seems that many textbooks do not provide enough information.
 A: Another way (apart from Giuseppe's answer) to show this might be the following:
The topology on $[-\infty,\infty]$ is generated by the sub-base of open rays
$(a,\infty]$ and $[-\infty,b)$ for all $a,b \in \mathbb{R}$. This is called the order topology (as given here). Therefore, every open set in $[-\infty,\infty]$ is an arbitrary union of finite intersections of sets of the form $(a,\infty]$, $[-\infty,b)$.
Let $U$ be an open set. If $\infty \in U$ then by definition it needs to be in
a finite number of sets of the form $(a,\infty]$. Therefore, there exists $y \in \mathbb{R}$ such that $(y,\infty] \subset U$. Similarly, if $-\infty \in U$ then there exists $x \in \mathbb{R}$ such that $[-\infty,x) \subset U$.
Now, if a real number $c \in U$ then again $c$ should belong to a finite number of sets of the form $(a,\infty]$, $[-\infty,b)$. Let's say $c$ belongs to $(a_i,\infty], i = 1,2,\cdots,m$ and $[-\infty,b_i), i = 1,2,\cdots,n$. Therefore $c\in (\max(a_i), \min(b_i))$ and hence $U-\{-\infty,\infty\}$ is open
in $\mathbb{R}$. Therefore, $U-\{-\infty,\infty\}$ can be written as a countable union of disjoint open intervals in $\mathbb{R}$.
Finally, given an open set $U \in [-\infty,\infty]$ we have $U= (U-\{-\infty,\infty\}) \cup (y,\infty] \cup [-\infty, x)$ (where $x,y$ are obtained as above). 
