Convergence of the sequence of step functions Let $n \in \mathbb{N}^\ast$, $f \in L^\infty(\mathbb{R})$ be piecewise continuous and $\{... x_{k-1}^n, x_k^n, x_{k+1}^n, ...\}$ a uniform partition of $\mathbb{R}$ such that for every  $k\in \mathbb{N},$ $x_k^n - x_{k-1}^n = \frac{1}{n} .$ Define the function $f_n$ on $\mathbb{R}$ such that  $f_n(x) = f(x_k^n)$ for $x\in ]x_{k-1}^n, x_k^n].$ 
In which sense the sequence $(f_n)$ converges to $f$ ? 
I started testing the pointwise convergence: 
Let $x \in \mathbb{R}.$ for all  $n\in \mathbb{N},$ there exists $x_k^n, x_{k-1}^n\in   \mathbb{R}$ such that $x\in ]x_{k-1}^n, x_{k}^n ].$ It is easy  to verify that $x_{k}^n \to x$ when $n \to +\infty$
  Consider now the sequence   $(f_n(x)).$ We have
$$f_n(x) = f(x_{k}^n).$$ 
It remains to see whether  $f(x_{k}^n) \to f(x).$ This is true for all $x\in \mathbb{R}$ except for the discontinuity points. 
Is there uniform convergence ?  
Thank you in advanced for any hint.  
 A: There are a few definitions of piecewise continuous. The most usual is I think the following:
$f:\Bbb R\to\Bbb R$ is piecewise continuous if for every interval $[a,b]$ there exists a finite partition $[a_n,a_{n+1}]$ and a continuous function $f_n  :[a_n,b_n]\to\Bbb R$ so that $f\lvert_{(a_n,b_n)}=f_n\lvert_{(a_n,b_n)}$.
If you do your construction with a continuous function $f:[a,b]\to\Bbb R$ you can see that you get uniform convergence. Now if you suppose that $f\lvert_{(a,b)}$ the restriction of a continuous function, you have uniform convergence of the construction on the inside $(a,b)$ (provided that $a,b$ are not in infinitely many of the partition points $x_{k}^n$), but not necessarily on the edge points $\{a,b\}$. This means you have convergence in $L^\infty$ norm on $[a,b]$.
If you piece together finitely many of such functions you still get $L^\infty$ convergence, provided only finitely many of the partition points are points of discontinuity. But if you do it with countably many you may not get this. As such I think the strongest form of convergence you can get with this level of generality is $L^\infty$ convergence on compacta.
