Measurable functions having different codomains I just started studying Rudin's RCA,and I find that the codomains of measurable functions appearing in statements vary.Sometimes $[0,∞]$,sometimes$[-∞,∞]$.
Since a measurable function is a function from a measurable space to a topology space in Rudin's book,different codomains have different topology.
I have difficulty to understand the topology of $[0,∞]$,how do we define it usually?I basically know nothing about topology apart from definition of topology space.
Is a measurable function with codomain $[0,∞]$ also measurable when regarded as a function with codomain $[-∞,∞]$?And does the converse hold?(consider the nonnegative measurable function with codomain $[-∞,∞]$)
Thanks for your help.
 A: In $(0,\infty]$ we use the subspace topology. As $(0,\infty]$ is an open subset of $[-\infty,\infty]$, the open sets 
 in the subspace topology of $(0,\infty]$ are open sets of $[-\infty,\infty]$ and all the open sets of $[-\infty,\infty]$ contained in $(0,\infty]$ are open sets in the subspace topology of $(0,\infty]$.
A: $[-\infty,\infty]$ is equipped with the order topology $\tau$ and (Borel) $\sigma$-algebra $\mathcal B=\sigma(\tau)$.
If $A\subseteq[-\infty,\infty]$ and $i:A\to[-\infty,\infty]$ denotes its inclusion then $A$ is equipped with subspace topology $i^{-1}(\tau)=\{A\cap U\mid U\in\tau\}$. 
This subspace topology induces at first hand the $\sigma$-algebra $\mathcal B_A:=\sigma(i^{-1}(\tau))$ but fortunately it can be shown that:$$\mathcal B_A=\sigma(i^{-1}(\tau))=i^{-1}(\sigma(\tau))=i^{-1}(\mathcal B)=\{A\cap B\mid B\in\mathcal B\}$$The second equality is essential here.
Now let $(\Omega,\mathcal A)$ be a measurable space and let $f:\Omega\to[-\infty,\infty]$ be a measurable function - that is $f^{-1}(\mathcal B)\subseteq\mathcal A$ - with $f(\Omega)\subseteq A$. 
Then the question rises: is $f$ also measurable if it is regarded as a function $\Omega\to A$? 
Fortunately the answer is: "yes". 
Observe that $f(\Omega)\subseteq A$ allows us to write $f=ig$ where $g:\Omega\to A$ is prescribed by $\omega\mapsto f(\omega)$. 
Then the actual question is now:  is  function $g:\Omega\to A$ measurable?  
Now observe that: $$g^{-1}(\mathcal B_A)=g^{-1}(i^{-1}(\sigma(\tau)))=(ig)^{-1}(\sigma(\tau))=f^{-1}(\sigma(\tau))=f^{-1}(\mathcal B)\subseteq\mathcal A$$which is exactly what we need for measurability of $g$.

If conversely we start with a measurable function $g:\Omega\to A$ then we might wonder whether it is measurable if it is looked at as a function $\Omega\to[-\infty,\infty]$.
That question can be rephrased as: is function $f:=ig:\Omega\to[-\infty,\infty]$ measurable?
Again the answer is "yes". 
For this note that $i:A\to[-\infty,\infty]$ is measurable simply because $i^{-1}(\mathcal B)=\mathcal B_A$.
Then $f=ig$ can be recognized as composition of two measurable functions  and a composition of measurable functions is measurable.
