In the book "Real-Analysis" of Stein and Shakarshi, they say that $f$ is measurable if $f^{-1}([-\infty ,\alpha ))$ is measurable for all $\alpha \in\mathbb R$ but in my course a function $f$ is said to be measurable if $f^{-1}((-\infty ,\alpha ))$ is measurable for all $\alpha \in\mathbb R$. Are both definitions equivalent? And if yes, why?
Furthermore, what sets are open in $[-\infty ,\infty ]$? Are they the sets of the form $]a,b[$, $[-\infty ,a)$ and $(b,+\infty ]$? And in $[-\infty ,\infty ]$ is $(-\infty ,a)$ still open ?
Sometimes, particularly in measure theory, people choose to consider the extended real line, or the real line with two points called $-\infty$ and $\infty$ adjoined. This is often written $[-\infty, \infty]$. This is a useful space to study since positive measures are functions from a $\sigma$-algebra to $[0,\infty]$, and integration by positive measures can yield $-\infty$ or $\infty$.
The extended real line is typically ordered by putting $\infty$ as the largest element and $-\infty$ as the smallest element. Once you have this order on the $[-\infty, \infty]$, the order topology can be put on the space. The open and closed sets are then the standard ones with respect to the order topology. It's a nice topology. The subspace topology of $(-\infty, \infty)$ with respect to it is the standard topology on $\mathbb{R}$, and $[-\infty, \infty]$ is compact and Hausdorff. In fact, it's homeomorphic to $[0,1]$.
However, $[-\infty, \infty]$ loses much of the algebraic niceness of $\mathbb{R}$. The expression $- \infty + \infty$ cannot be coherently defined. For this reason, attention is often restricted to functions on $[0,\infty]$ (like positive measures), where addition and multiplication can be nicely defined (put $0 * \infty = 0$).
In the context of your book, they are defining measurability of extended real-valued functions; in class, they are defining it for real-valued functions. Since the subspace topology of $(-\infty, \infty)$ in $[-\infty, \infty]$ is the standard topology on $\mathbb{R}$, these definitions coincide for all real-valued functions. Your book is just being a bit more general.