1) Random Variable Definition:
A function \( f: \Omega \to \mathbb{R} \) is a random variable with respect to a sigma-algebra \( \mathcal{G} \) if the pre-image of any Borel set in \( \mathbb{R} \) is in \( \mathcal{G} \).
2) Analyzing \( X \):
The function \( X \) is defined as:
\[
X(\omega) =
\begin{cases}
1 & \text{if } \omega \in [0,1] \\
2 & \text{if } \omega \in (1,2]
\end{cases}
\]
The pre-images of the sets \( \{1\} \) and \( \{2\} \), which are \( \{[0,1]\} \) and \( \{(1,2]\} \), are both elements of the sigma-algebra \( \mathcal{G} \), hence \( X \) is a random variable with respect to \( \mathcal{G} \).
3) Analyzing \( Y \):
The function \( Y \) is defined as:
\[
Y(\omega) =
\begin{cases}
2 & \text{if } \omega \in [0,1.5] \\
3 & \text{if } \omega \in (1.5,2]
\end{cases}
\]
The pre-images of the sets \( \{2\} \) and \( \{3\} \) are \( \{[0,1.5]\} \) and \( \{(1.5,2]\} \), but \( \{[0,1.5]\} \) is not in \( \mathcal{G} \) (since \( [0,1.5] \) is not one of the sets in the sigma-algebra \( \mathcal{G} \)). Therefore, \( Y \) is not a random variable with respect to \( \mathcal{G} \).
Hence, the correct answer is (A).