Prove that a function $f:\mathbb{R}\rightarrow\mathbb{R}$ is a Borel function if and only if for any $c$, the set $f^{-1}((c,\infty))$ is a Borel set.
Recall that a Borel set is obtained from open and closed sets using the combination of complement, countable unions, and countable intersections. From this definition, a Borel set is measurable but a measurable set may not be a Borel set. A function $f:\mathbb{R}\rightarrow\mathbb{R}$ is called a Borel function if the preimage of any Borel set $B$ is a Borel set (i.e. $f^{-1}(B)$ is a Borel set whenever $B$ is a Borel set).
We define a Borel function by saying $f^{-1}(B)$ is Borel whenever $B$ is Borel; but we do not define a measurable function by saying that the preimage of a measurable set is measurable because a continuous function may not satisfy this condition.
This is what I have so far, but I'm not sure about the forward direction.
($\Leftarrow$) Suppose for any $c$, the set $f^{-1}((c,\infty))=\{x\in\mathbb{R}:f(x)>c\}$ is a Borel set. We know that any open set can be written as a countable union of disjoint open intervals. The collection of all sets formed this way is the Borel collection where a set in the collection is a Borel set. So, every open set is a Borel set. Let $B=\{x\in \mathbb{R}:x\in (c,\infty)\}$. By definition, a function is a Borel function if the preimage of any Borel set $B$ is a Borel set. Hence $f$ is a Borel function.
To prove it, note $f^{-1}$ preserves unions, intersections and complements. And Borel sets=$\sigma(\{(c,\infty),c\in \mathbb{R}\})$.
Also, why would functions such that "the preimage of a measurable set is measurable" not a measurable function?