1) I am aware that a continuous random variable cannot be obtained from a sample space that is countably infinite or finite. In other words, the sample space of an experiment has to be uncountably infinite in order for one to be able to assign a meaningful continuous random variable. But can one define a discrete random variable on an uncountably infinite sample space? Or does an uncountably infinite sample space only allow us to define a continuous random variable?
2) My second question is somewhat different and relates to continuous random variables specifically. Given a continuous random variable $X$ and a real-valued function $g$, $g(X)$ is a random variable. However, unlike the discrete case wherein functions of discrete random variables are inevitably discrete, this need not be the case for functions of continuous random variables. If $X$ is continuous, $g(X)$ can be continuous or discrete. I find this confusing because in order for us to define a continuous random variable $X$ to start with we need an uncountably infinite sample space. But given that uncountably infinite sample space how can one associate with it a discrete random variable $g(X)$? Finally, does one define a probability mass function for $g(X)$ if it turns out to be discrete?