In preparation for defining the integral, we introduce the notion of both simple functions and measurable functions. We then state a bunch of useful properties regarding measurable functions.
Note that simple or measurable random variables are just simple or measurable functions on a probability space.
My typed notes can be found at https://sites.ualberta.ca/~kashlak/kashTeaching.html