Prove that $X : \Omega \to \Bbb R$ is a random variable if $X$ is constant. I have to prove this:

Let $(\Omega, \mathcal F)$ be a measurable space,  $\mathcal F=\{\emptyset,  \Omega\}$ prove that   $X : \Omega \to \Bbb R$ is a random variable if and only if $X$ is constant.

I've tried using that $X$ is a random variable iff $X^{-1}B \in \mathcal F$ if $B$ is a Borel set but I cannot conclude anything, also I´ve tried with the other definition: $X$ is a random variable iff $(X \le x) \in \mathcal F$ $  \forall x \in R$.
Any hint or idea about what definition of random variable should I use?

Use the second definition. Let $c=\sup \{x:\{X\leq x\} \neq \Omega\}$. Verify that $-\infty<c<\infty$. Note that $\{X\leq x\}=\Omega$ for $x>c$ and conclude that $X\leq c$. Next,note that $\{X\leq x\}=\emptyset$ for all $x<c$. Conclude that $X=c$.
