In my notes I have
where $I$ is the interval on which $X$ takes values. I am struggling to see why do we require for our random variable to be contained in an interval. I thought looking at the proof will show us why but I can't seem to find where it breaks. I am referencing page 29 of https://www.statslab.cam.ac.uk/~james/Lectures/pm.pdf .
Question: Is it result still true for when $I= \mathbb R$ instead?