Sample space for discrete random variables Can discrete random variables be defined in a continuous sample space?

Continuous sample space is a non countable sample space!
 A: For simplicity, let us assume that by "continuous sample space" you mean the real line $\mathbb R$. 

The corresponding probability space is $(\Omega, \mathcal F, P)$ where $\mathcal F$ is the $\sigma$-algebra of events defined on $\Omega$ and $P$ is the probability measure that specifies the probability of each event in the $\sigma$-algebra. For the sample space $\mathbb R$, one can take the $\sigma$-algebra to be generated the intervals $(-\infty, x]$ and use any continuous nondecreasing function $F$ with limiting values $0$ as $x\to -\infty$ and value $1$ as $x \to \infty$ to define the probability of $(-\infty, x]$ to be $F(x)$. 

If the highlighted paragraph above is gobbledygook to you, just ignore it, and concentrate on what follows next.
It is straightforward to define a discrete random variable on this sample space $\Omega = \mathbb R$. For example, one could define a discrete random variable $X$ as one that maps the outcome $\omega \in \Omega$ (this outcome is a just an ordinary real number) to $1$ if $\omega \leq 0$ and to $0$ if $\omega > 0$.  $X$ is then just a Bernoulli random variable with parameter $p= P(\omega \leq 0)$. 

The gobbledygook in the highlighted paragraph above just says that it makes sense to talk about the probability that the outcome $\omega$ is no larger than $0$, or more generally, the probability that the outcome
  $\omega$ is no larger than a specified real number $x$, and that this probability $P(\omega \leq x)$ is just the value of the function $F$ at $x$.  In whuber's answer, he has chosen $F$ to be $\Phi$, the cumulative probability distribution function (CDF) of the standard normal random variable.

A: Part of what makes a set a "sample space" is that we designate certain subsets and call them "events."  Not every subset of a sample space can have a probability: only events have probabilities.  This restriction is needed to avoid paradoxes when extending the concept of probability from a finite sample space to uncountably infinite sample spaces.
Unless the sample space is trivial--which means it and the empty set are the only events--there will be some event $\mathcal E$ that is neither empty nor the whole space.  The probability axioms assure us that the complement of $\mathcal E$--let's call it $\mathcal F$--is also an event.

Define the random variable $X$ to have the value $1$ for all elements of $\mathcal E$ and otherwise have the value $0.$ 

(This is known as the indicator function of $\mathcal E.$)  $X$ is discrete because it takes on only two values, $0$ and $1.$  Indeed, the probability that $X=1$ is the probability of $\mathcal E$ and the probability that $X=0$ is the remaining probability (the two probabilities must sum to $1.$)

As an example, consider the sample space of the real numbers with its usual events (determined by the half intervals $(-\infty, a]$) and endow it with a standard Normal probability, so that for all numbers $a,$
$$\Pr((-\infty, a]) = \Phi(a) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^a e^{-x^2/2}\,\mathrm{d}x.\tag{1}$$
Pick an event, such as $\mathcal E = (-\infty,0].$  In the foregoing construction, $X(\omega)=1$ for all non-positive numbers $\omega$ and otherwise $X(\omega)=0$ for positive numbers.  $X$ is a random variable.  It has a Bernoulli$(1/2)$ distribution (it's a "fair coin") because the chance that $X=1,$ according to formula $(1),$ is $\Phi(0)=1/2.$

Every discrete distribution corresponds to some random variable that is constructed with a generalization of this approach. 
When you can find a finite or countable number of nonoverlapping events $\mathcal{E}_1, \mathcal{E}_2, \ldots$ whose probabilities sum to $1$ (which is always possible in the preceding example of the real numbers with a standard Normal probability function), you may assign an arbitrary value $x_1$ to all the elements of $\mathcal{E}_1,$ another (or even the same) value $x_2$ to all the elements of $\mathcal{E}_2,$ and so on.  This almost defines a random variable $X.$  There may be a few elements not contained in any of the $\mathcal{E}_i.$  Let the set of all such elements be called $\mathcal{E}_0.$  The axioms of probability imply $\mathcal{E}_0$ has zero probability. You can assign any values you like to the elements of $\mathcal{E}_0.$  This effectively defines a whole class of random variables that equal $X$ "almost everywhere."  They all have the same (discrete) probability distribution.
