Topology and Borel sets of extended real line

The topology $\mathcal{T}_{\overline{\mathbb{R}}}$ you are looking for is defined in the following way: $A\in\mathcal{T}_{\overline{\mathbb{R}}}$ iff

  1. $A \cap \mathbb{R}$ is open in the standard topology of $\mathbb{R}$;

  2. if $-\infty \in A$ then there is $r\in \mathbb{R}$ such that $[-\infty, r]\subseteq A$, and

  3. if $+\infty \in A$ then there is $s\in \mathbb{R}$ such that $[s, +\infty]\subseteq A$.

It is easy to prove that $\mathcal{T}_{\overline{\mathbb{R}}}$ is a topology. In fact this is precisely the topology induced by the metric $$d(x, y) = |\arctan x - \arctan y|$$ This topology makes $\overline{\mathbb{R}}$ a compact space. It is also easy to prove that $\mathcal{B}_{\overline{\mathbb{R}}} = \sigma(\mathcal{T}_{\overline{\mathbb{R}}})$.

Now for the result:

Let $(X,\tau)$ be any topological space. If $f: X \to \mathbb{R}$ is continuous w.r.t. $\tau$ and the standard topology of $\mathbb{R}$ and we extend the counterdomain of $f$ to $\overline{\mathbb{R}}$ then the function $\overline{f}: X \to \overline{\mathbb{R}}$ is continuous w.r.t. $\tau$ and $\mathcal{T}_{\overline{\mathbb{R}}}$.

The resul is immediate. Just note that $i: \mathbb{R} \to \overline{\mathbb{R}}$ defined by $i(x)=x$, for all $x \in \mathbb{R}$, is continuous w.r.t. the standard topology of $\mathbb{R}$ and $\mathcal{T}_{\overline{\mathbb{R}}}$ and $\overline{f}=i \circ f$.