Struggling to understand proof in introductory measure theory from Rudin So below is an excerpt from Rudin's book on "Real and Complex Analysis". The proof just confuses me quite a lot perhaps because of the fact that there's quite a few variables floating around. I've tried to highlight specific points which I believe are stopping me from understanding this. 
First why does he define function (1) like this? Second, why is it a Borel function, or on what basis is that true? 

P.S. I'm not asking for complete explanation per se, but some idea of what is going on would be good, thanks a lot!
 A: The function $\varphi_n$ rounds $t$ down to the nearest multiple of $\frac{1}{2^n}$, until $t$ reaches $n$.  At that point $\phi_n$ levels off to the constant $n$.  For instance, here is a graph of $\phi_2$:

So $\varphi_n$ takes finitely many values on a finite partition of $[0,\infty]$.  That should be enough to show that it's Borel measurable.  If you draw a number of these, you'll see why $0 \leq \varphi_n(t) \leq \varphi_{n+1}(t)\leq t$ for all $n$, and $\varphi_n(t) \to t$ as $n\to\infty$ for all $t$.  
Composing a measurable function $f$ with $\varphi_n$ is going to round the values of $f$ down to the nearest multiple of $\frac{1}{2^n}$, up to a certain point.
A: Our goal is to approximate f with an increasing sequence of simple functions - measurable, with finitely many values. We will do that by partitioning the codomain of f into intervals, and assigning only one value to the preimage of every interval.
If we want to get f in the limit we need to watch out for two things. First, our intervals should be getting smaller in size, so that we approximate values of f more accurately with each partition. Second, since our codomain is infinite, $[0,\infty>$, we need to expand our partition as well as making it finer.
So now that we know what we need to do it's time to get down to bussiness!
In every iteration we will partition the interval $[0,n]$ (so that our partition expands) and we will partition $[0,n]$ into parts of length $\frac{1}{2^n}$ (so that it gets finer). 
The function $\varphi_n$ in Rudin's book partitions the codomain by assigning values to its elements like so:
$$\varphi_n(y)=\begin{cases} \frac{k-1}{2^n}, & y\in[\frac{k-1}{2^n}, \frac{k}{2^{n}}>, k=1,...n*2^n \\ n, & y\ge n*2^n\end{cases}$$
Every $\varphi_n$ is obviously a measurable simple function (measurability follows from the fact that the preimage of any set is just a union of intervals), and since f is measurable so is $s_n:=\varphi_n\circ  f$. Furthermore, $s_n$ is simple since it has finitely many values, and the sequence $(s_n)_n$ is non-decreasing (we always choose the lower part of an interval in a partition to be the value, so by refining the partition the value can only go up). 
Furthermore, for every $y\ge 0$ there is a sequence of numbers of the form $\frac{k}{2^n}$ which tends to y from below (prove it!), so $s_n\to f$.
The picture in Matthew's answer should give you the idea of whats going on, but I would advise you to draw it by hand for something like n=2, and make it something more complicated than a line - you will always picture it vividly after that.
