Yes, you're correct--$Y$ is the domain of the probability mass function. And adding to what user Mike Earnest has said, it's a set which contains all the possible values of $X$ (and possibly more elements), and the line $P(X\in Y)=1$ means that $X$ surely has a value which is an element of $Y$ (in other words, $Y$ contains all the possible values of $X$).
For example, let $X$ be a random variable such that $P(X=1)=P(X=2)=P(X=3)=P(X=4)=\frac14$.
The most straightforward choice of $Y$ is $\{1,2,3,4\}$. If $Y$ is chosen as such, you can see that the probability that the value of $X$ is in $Y$ is $1$, and the probability mass function of $X$ is
$$p(x)=P(X=x)=\frac14\text{ for }x\in \{1,2,3,4\}\text.$$
We can also take $Y=\{0,1,2,3,4,5\}$. Then the probability mass function of $X$ is
$$p(x)=P(X=x)=\cases{\frac14& for $x\in \{1,2,3,4\}$\\0&for $x\in \{0,5\}$}$$
Here the probability that the value of $X$ is in $Y$ is still $1$, but not every member of $Y$ is a possible value for $X$ (see $0$ and $5$). The point is that it is possible to choose a countable set $Y$ which comprises all the possible values of $X$.
For contrast, let's take a look at another random variable, say $Z$, which can take on any value in the interval $[0,1]$ with uniform probability distribution. Because $[0,1]$ is uncountable, we cannot choose a countable set $Y$ which contains all the possible values of $X$, because such a set would have to have an uncountable subset, that is, $[0,1]$. Therefore, $Z$ is not a discrete random variable.
The statement you give can be viewed as a theorem (if $p$ then $q$) rather than a definition of $q$:
Theorem: Fix probability space $(\Omega, \mathcal{F}, P)$. If $\Omega$ is a finite or countably infinite sample space then every random variable $X:\Omega\rightarrow \mathbb{R}$ must be a discrete random variable.
Proof: Let $X:\Omega\rightarrow\mathbb{R}$ be a random variable. If $\Omega$ is finite or countably infinite then the image $X(\Omega)$ is finite or countably infinite. $\Box$
The nice thing about random variables is that, once you know their distribution, you do not need to know the sample space. Most people would define a binary-valued Bernoulli random variable to be a discrete random variable, even if the sample space is uncountably infinite. If your professor is suggesting that all discrete random variables have finite or countably infinite sample spaces, then your professor is "cutting corners" for convenience. Such a definition is not satisfactory because it would never allow a probability space to have two random variables $X:\Omega\rightarrow\mathbb{R}$ and $Y:\Omega\rightarrow\mathbb{R}$ such that $X$ is discrete and $Y$ is continuous. You can see the professor is already cutting corners by assuming the sigma algebra is just the full power set. [This is not necessarily bad: Most of the basic probability concepts can be developed on finite or countably infinite sample spaces and using the power set sigma algebra. But one must use uncountably infinite sample spaces (and more sophisticated sigma algebras) when treating more advanced things such as continuous random variables and/or infinite sequences of random variables.]
There are various definitions of "discrete random variable" that are used: Let $(\Omega, \mathcal{F}, P)$ be a probability space (the sample space $\Omega$ can be uncountably infinite).
Definition 1: A random variable $X:\Omega\rightarrow\mathbb{R}$ is said to be discrete if the image $X(\Omega)$ is a finite or countably infinite set.
Definition 2 (not equivalent): A random variable $X:\Omega\rightarrow\mathbb{R}$ is said to be discrete if there is a finite or countably infinite subset $A \subseteq \mathbb{R}$ such that $P[X \in A]=1$.
It is easy to prove that if a random variable satisfies definition 1 then it also satisfies definition 2. Thus, the proof of the theorem I stated in the first part of my answer holds under either of these two definitions of "discrete random variable."
Of course, definition 2 is more general and it is possible for a random variable to satisfy definition 2 without satisfying definition 1: Consider the probability space $([0,1], \mathcal{B}([0,1]), \lambda)$ where $\lambda$ is the standard Borel measure (length) on the unit interval. Let $V$ be any uncountably infinite and Borel measurable subset of $[0,1]$ that has $\lambda(V)=0$. Define the random variable $X:\Omega\rightarrow\mathbb{R}$ by
$$ X(\omega) = \left\{\begin{array}{cc}
0 & \mbox{ if $\omega < 1/2$ and $\omega \notin V$} \\
1 & \mbox{ if $\omega\geq 1/2$ and $\omega \notin V$} \\
\omega & \mbox{ if $\omega \in V$}
\end{array}\right.$$
Then $X(\Omega) = V \cup \{0,1\}$ is uncountably infinite so $X$ does not satisfy definition 1. But $X$ satisfies definition 2 with $A=\{0,1\}$. The distribution of $X$ is $Bernoulli(1/2)$.
Best Answer
The notation $P(X=x)$ refers to the probability that $X$ is exactly $x$. For a continuous r.v., we consider the probability of $X$ within a range. The probability of $X$ equal to a particular value is always 0.
Technically speaking, a continuous r.v. is usually presented in this way:
$P(a\leq X\leq b)=\int_{a}^{b} f_X(x)dx$
Therefore, $P(X=c)=\int_c^c f_X(x)dx=0$.
In terms of verbal interpretation, you may consider a continuous uniform distribution over $[0,1]$, i.e. $X\sim U[0,1]$. Since there are infinitely many values within the domain, $P(X)=\dfrac{1}{\infty}=0$.
Therefore, the definition of probability has to be revised if it is to be extended to continuous r.v.