Example of Riemann integrable $f: [0,1] \to \mathbb R $ whose set of discontinuity points is an uncountable and dense set in $[0,1]$ Give example of a function $f:  [0,1] \to \mathbb R $ which is integrable ( Lebesgue or Riemann , if possible , both) but whose set of discontinuity points is  an uncountable set and dense in $[0,1]$ ?
 A: An example of Lebesgue integrable function is easy, as shown in other answers.
It is a known fact that a function $f: \mathbb{R} \to \mathbb{R}$ is Riemann integrable if and only if $f$ is bounded and the set of discontinuities has measure zero.
Let $C$ be the usual ternary Cantor set, and let $\mathbb{Q}$ denote the set of rational numbers. The function
$$f(x) = \begin{cases}
200,  &x \in C \\
1/q, &x = p/q \text{ is rational in lowest terms and } x \notin C \\
0, &\text{otherwise}
\end{cases}
$$
is discontinuous in $C \cup \mathbb{Q}$, which is uncountable and dense but has measure zero (hence $f$ is Riemann integrable).
A: An easy example is this: Let $C$ be the Cantor set and denote by $\chi_C$ its characteristic function, so that for $x\in[0,1]$, we have that $\chi_C(x)=0$ if $x\notin C$, and $\chi_C(x)=1$ if $x\in C$. Clearly $\chi_C$ is bounded, $0\le\chi_C(x)\le 1$ for all $x$. This function is discontinuous at an uncountable set of points (all points in $C$, because they are limit of points not in $C$, since $C$ is nowhere dense, but they are alos limit of points in $C$, since $C$ is perfect). 
Now, let $i$ be the increasing function obtained by enumerating the rationals in $[0,1]$, say $q_0,q_1,\dots$, and letting $i(x)=\sum_{q_n\le x}2^{-n}$, that is, given $x\in[0,1]$, we look at the set of rationals in $[0,x]$, we look at the set $I\subseteq\mathbb N$ of indices of these rationals (according to our enumeration), and then set $i(x)=\sum_{n\in I}2^{-n}$. Clearly $i$ is bounded, $0\le i(x)\le 2$ for all $x$. The set of discontinuities of $i$ is dense in $[0,1]$ (because $i$ is discontinuous precisely at the points in $\mathbb Q\cap[0,1]$. That these are discontinuity points is easy to see, since we explicitly added jumps there. But if $x$ is irrational, for any $N$, in a sufficiently small neighborhood of $x$ we only find rationals with indices larger than $N$, and $\sum_{j>N}2^{-j}=\tau$ can be made arbitrarily small by choosing $N$ sufficiently large. Now, if $y$ is any point in that neighborhood, then $|i(x)-i(y)|\le2\tau$, so $i$ is continuous at $x$).
Finally, $f=\chi_C+i$ is Riemann integrable, and its set of discontinuities is both dense and uncountable. One can argue directly about its integrability, or one can quote Lebesgue's characterization, that a function is Riemann integrable iff it is bounded and its set of discontinuities has measure zero. But both $C$ and $\mathbb Q\cap[0,1]$ have measure zero, and so does their union.
A: If you mean Lebesgue integrable, then $f(x) = \begin{cases} 0 & x \in \mathbb{Q} \cap [0,1] \\ 1 & x \not \in [0,1] \cap \mathbb{Q} \\ \end{cases}$ is a function that is discontinuous at every irrational (hence on an uncountable, dense set), but it is integrable, and $\int \limits_{[0,1]} f(x) \,d\mu = 0m(\mathbb{Q} \cap [0,1]) + 1m(\mathbb{Q}^{c} \cap [0,1]) = 0 \cdot 0 + 1 \cdot 1 = 1$.
Note that this function is not Riemann integrable.  Do you know why?
If you want a function that is Riemann integrable, but is discontinuous at an uncountable dense set, then you need to construct a function whose set of discontinuities is both uncountable and a set of measure $0$ (since a function is Riemann integrable iff its set of discontinuities has measure $0$).
