We define measurable functions as follows:
Definition
Let $(X,\mathcal S)$ be a measurable space.Then $f:X\to \mathbb R$ is called measurable function if $f^{-1}(B)\in \mathcal S$ for any Borel set $B\subset \mathbb R$.
The book by Sheldon Axler on Measure theory gives an equivalent condition:
$f:X\to \mathbb R$ is measurable iff $f^{-1}(a,\infty)\in \mathcal S$ for each $a\in \mathbb R$.
I want to know how to prove this.Can someone give me a hint.I also want some moivation behind this theorem.
Let me just give you the ingredients you would need to prove it by yourself. First of all, let $(X, \mathcal{S})$ and $(Y, \mathcal{B})$ be two measurable spaces.
Definition: A function $f: (X, \mathcal{S}) \to (Y, \mathcal{B})$ is said to be measurable if, for every $B \in \mathcal{B}$, $f^{-1}(B) \in \mathcal{S}$.
In the case $Y = \mathbb{R}$ and $\mathcal{B} = \mathbb{B}_{\mathbb{R}}$ is the Borel $\sigma$-algebra, the above definition becomes the one in the OP post.
Now, let $X$ be a set and $\mathcal{C}$ be a collection of subsets of $X$.
Exercise 1: Show that the intersection of all $\sigma$-algebras of subsets of $X$ which contain $\mathcal{C}$ is again a $\sigma$-algebra. This is the smallest $\sigma$-algebra of subsets of $X$ which contains $\mathcal{C}$, which is called $\sigma$-algebra generated by $\mathcal{C}$ and is usually denoted by $\sigma(\mathcal{C})$.
Exercise 2: With the above notation, suppose $\mathcal{B} = \sigma(\mathcal{C})$, that is, $\mathcal{B}$ is the $\sigma$-algebra generated by some collection $\mathcal{C}$ of subsets of $Y$. Show that $f: (X, \mathcal{S}) \to (Y,\mathcal{B})$ is measurable iff for every $C \in \mathcal{C}$, $f^{-1}(C) \in \mathcal{S}$. In other words, you just need to check the condition for the elements of $\mathcal{C}$.
Finally, I don't know how you defined the Borel $\sigma$-algebra $\mathbb{B}_{\mathbb{R}}$, but I will guess that it is defined as the smallest $\sigma$-algebra containing the open intervals $(a,b)$ (note that $\mathbb{B}_{\mathbb{R}}$ is itself a $\sigma$-algebra generated by a collection of subsets of $\mathbb{R}$).
Exercise 3: Show that $\mathbb{B}_{\mathbb{R}}$ is the $\sigma$-algebra generated by intervals of the form $(a,\infty)$, $a \in \mathbb{R}$.
Combining exercise 3 with exercise 2 you get your answer.