What is the formalism that allows Random Variables to be treated algebraically like real or complex numbers? We all know that if we have a variable x, then there is a meaning to - for example - 
$$y=e^x$$.  
And we all know how to manipulate that algebraically and to do calculus.  For example, if 
$$y_1=e^{x_1}$$
and 
$$y_2=e^{x_2}$$
then 
$$y_1y_2 = e^{x_1+x_2}$$
But random variables are a very different beast. Ultimately we all know intuitively what we mean when we draw a PDF or, more accurately, the CDF which is itself an algebraic function mapping $[-\infty, \infty]$ to $[0,1]$ as part of that defines a random variable.
But what is the actual math that makes that definition of an RV actually act algebraically, so that, as above, we can happily write things like 
$$Y_1=e^{X_1}$$
and 
$$Y_2=e^{X_2}$$
then 
$$Y_1Y_2 = e^{X_1+X_2}$$
where $X_1$ and $X_2$ are random variables - and get away with it???
 A: Formally $X_i$ are real valued (measurable) functions i.e $X_i\colon \Omega\to \mathbb{R}$ for $i=1,2$ where $\Omega$ is the sample space. So 
$$
Y_i=e^{X_i}
$$
for $i=1,2$ as an equality of functions means that
$$
Y_i(\omega)=e^{X_i(\omega)}
$$
for all $\omega\in \Omega$. Hence since $X_i(\omega)$ is a real number it follows using the first part of your question that
$$
Y_1(\omega)Y_2(\omega)=e^{X_1(\omega)}e^{X_2(\omega)}=e^{X_1(\omega)+X_2(\omega)}
$$
for all $\omega$ whence as functions
$$
Y_1Y_2=e^{X_1+X_2}.
$$
A: Formally a random variable is simply a measurable function $X:\Omega\to \mathbb R$, where $\Omega$ is a sample space equipped with some sigma algebra, $\Sigma$, containing the events we are interested in, and a probability measure $\mathbb P$. We call the triple $(\Omega, \Sigma, \mathbb P)$ a probability space. Thus if $g:\mathbb R\to \mathbb R$ is some "regular" function, $g\circ X:\Omega\to \mathbb R$ is simply the function mapping $\Omega\ni\omega\mapsto g(X(\omega))$. Thus if $X_1$ and $X_2$ are both random variables on the same probability space it is easy to talk about things like $g\circ(X_1+X_2)$. This is simply the map $\omega\mapsto g(X_1(\omega)+X_2(\omega))$.
For an example we can consider the most simple of experiments: flipping a fair coin twice. Then our sample space is $\Omega=\{HH,HT,TH,TT\}$, and our $\sigma$-algebra is simply the power set. The most natural probability measure is the one assigning a value of $1/4$ to each singleton in $\Omega$. Suppose we win a bet if in the experiment two heads occur. We can then capture this by the random variable $X:\Omega\to \mathbb R$ given by $X(HH)=1$ and $X$ is $0$ on all other elements of $\Omega$. Thus we see $X$ is simply a function, just not from $\mathbb R$ to itself.
Often in statistics we actually don't see $\Omega$ written out explicitly, because it often consists of weird things, like the population of the earth, but it is always exists underneath when we're doing probability calculations. In fact for a r.v. $X$ the CDF, $F_X$ is defined in terms of the probability space as follows
$$F_X(x)=\mathbb P\{\omega\in \Omega:X(\omega)\leq x\}.$$
