How is a mixed random variable a random variable? A random variable is a function from the sample space to the real numbers. How is a mixed random variable a function from the sample space to the real numbers?
For example, suppose $X$ is uniform on $[0,2]$ with probability $1/2$ and $X = 1$ with probability $1/2$. $X$ is a mixed random variable, how is it a random variable?
 A: There are many underlying sample spaces for a given random variable, none of which we really care about, so let's go abstract (this may feel a bit tautological since it's all just definitions, nothing really derived here)
Here our random variable is a function from the sample space to a subset of the reals $D$: $X:\Omega \to \mathbb{R},\; \omega \mapsto [0,2]$
We don't care what $\Omega$ is, just that it exists and it needs to be uncountable (to support outcomes along a continuum). All we need it for is to allow us to assign probabilities to the outcomes of $X(\omega)$ to match your random variable definition.
Let's partition $\Omega$ into two sets as follows:
$U=\{X^{-1}(1)\cap \Omega\}$ is the pre-image of $X$ of all the points in $\Omega$ that map to $1$.
$V = U^c$ is the rest of the sample space.
Next we define our probability measure.
First, we need to specify a $\sigma-$field $\mathcal{F}$ that our probability measure is defined on (it needs to contain all the possible sets we need to be able to answer or infer probability assessments for). In our case, we need to allow questions such as $P(X \in [1,2])$ so we need to define it over a collection of subsets of $\Omega$ that allow these questions. The simplest one is the sigma algebra generated by $X$:
$$\mathcal{F} = \sigma(X) = \{X^{-1}(A):A\in \mathcal{B}\left([0,2]\right)\}$$
Plainly, this is a collection of sets created by the preimages of all intervals in the Borel Sigma Algebra on $[0,2]$.
The probability measure that works here is as follows:
$$\forall A\in\mathcal{F}\;\;\; P(A) = \cases{0.5 \;\text{ if }A=U\\ \frac{\text{Leb}(X(A))}{2}\; \text{ otherwise}}\;\; $$
Putting it together, we get the abstract probability space $S=(\Omega, \mathcal{F},P)$ on top of which we can define the measurable function $X(\omega)$, where $X$'s co-domain is the measurable space:
$$C=\left([0,2],\mathcal{B}([0,2])\right)$$
So in the coin flip example given by Michael, we can define two random variables on the same sample space $S$: First one is $X(\omega)$ from before and the second is $Y(\omega)$ defined as follows:
$$Y(\omega) = \cases{H \;\quad\forall\omega \in U &\\T\;\;\quad\forall \omega \in V}$$
Then we have a joint result $J(\omega) = \left( Y(\omega),X(\omega)\right)$ of which we can "throw away" $Y(\omega)$ since we only care about $X(\omega)$
Normally we don't really care about the underlying sample space that supports a random variable and we don't work directly with the joint distribution produced by $J$.
Instead, we do what Michael suggested-- we condition on the coin flip $Y$ and then draw from the conditional distribution of $X|Y$:
$$P(X\cap Y) = P(Y)P(X|Y)$$
This just says "Flip the coin, then draw X from the conditional distribution"
Since we don't actually see $Y$, we just want the unconditional probability:
$$P(X) = P(H)P(X|H)+ P(T)P(X|T)$$
See https://stats.stackexchange.com/questions/292200/the-fundamental-theorem-of-simulation
