Is $f$ necessarily measurable? (1) Suppose a function $f$ has a [Lebesgue] measurable domain and is continuous except at a finite number of points. Is $f$ is necessarily [Lebesgue] measurable?

Comments For (1), If $f$ is defined on a [Lebesgue] measurable set $E$ and is continuous except for a finite number of values say $x_1,x_2, ... x_n$ are those points of discontinuity, then can't we describe the pre-images of $f$ just as a finite union of of the pre-images of the collection of continuous functions $\{f_i\}_{i=1}^{n}$, where each $f_i$ is defined up between each point of discontinuity of $f$? Or am I missing something here?

(2) Suppose the function $f$ is defined on a measurable set $E$ and has the property that $\{x \in E | f(x) > c\}$ is measurable for each rational number $c$. Is $f$ necessarily [Lebesgue] measurable?
 Comments I got this one, thanks to everyone who commented.
Any hints would be appreciated.
The text being used is Royden-Fitzpatrick 4th Edition.
 A: What about this for the first question:
Let $A$ be the measurable domain of $f$ and let $X=\{x_i\}_{i=1}^n$ be the finite collection of discontinuities. Since $|X|$ is finite, we can order them from smallest, say $x_1$, to largest, say $x_n$. Then for $1\le i\le n+1$ define
$$
A_i=A\cap (x_{i-1},x_i),
$$
where $x_0=-\infty$ and $x_{n+1}=\infty$. Observe that each $A_i$ is measurable and
$$
\{x\in A\,:\, f(x)>c\}=\left(\bigcup_{i=1}^{n+1}\{x\in A_i\,:\, f(x)>c\}\right) \cup \{x\in X\,:\,f(x)>c\}
$$
For each $c$, each set in the indexed union is measurable (because $f$ is measurable on each A_i) and each subset of $X$ is either empty or contains no more than $n$ points and is therefore measurable as well.
A: (2) It is true, this not contradicts the proposition 1 (Page 54), just is an equivalent form of proposition 1.
Suppose $\{x\in E : f(x)>c\}$ measurable for each rational $c$. Let $r\in\mathbb{R}$, then exist a sequence $\{c_n\}$ of rational numbers such that $c_n\to r$ and $c_n\geq r$ for all $n\in\mathbb{N}$. Note that
$$A=\{x\in E : f(x)>r\}=\{x\in E : f(x)\leq r\}^c=\left(\bigcap\{x\in E : f(x)\leq c_n\}\right)^c=\bigcup \{x\in E : f(x)> c_n\}$$
Hence $A$ is measurable. Try (1) by yourself.
(1) When you say "where each $f_i$ is defined up between each point of discontinuity of $f$" you are wrong, $E$ does not necessarily has a good order, we only know that $E$ is a topological space. If you don't assume that each open set in a topology space must be measurable, (1) is obviously false (indeed, proposition 3 in page 55 Royden 4th ed. will fail). The correct word in this Royden Chapter is Lebesgue Measurable functions instead of measurable function, then we know that $E\subset\mathbb{R}$.
If $E\subset\mathbb{R}$ (1) is true. Instead of considering $f_n$ consider simply $f|\{E\setminus{x_1,\ldots,x_n}\}$, define $f(x_i)=y_i\in\mathbb{R}$. What happen when an open interval $I$ contains some of $y_i$? (in this case is much easier work with $y_n$ rather than $x_n$)
How fails "preimage of open set is open" when a continuous function $f\colon\mathbb{R}\to\mathbb{R}$ has finitely many discontinuities?. Note that the only case of preimage of an open interval that is not an open set correspond to closed intervals, semi-open intervals (for example in $[a,b)$ form) or numerable union of them, so that not only the function $f$ is measurable, it is also Borel measurable (preimage of open sets are Borel Measurable).
In any topological space $(X,\tau)$ where each open set is measurable, and consider as measurable sets the Borel $\sigma$-algebra (the smallest sigma algebra containing the open sets) I don't know if (1) is true.
