[Math] Is the uniform limit of piecewise continuous functions $f:[a,b]\rightarrow\mathbb{R}$ piecewise continuous

uniform-convergence

Let $(f_n)$ be a sequence of functions $f_n:[a,b]\to\mathbb{R}$, all of which are piecewise continuous. Does $f_n\rightrightarrows f$ imply that $f$ is piecewise continuous?

EDIT:

I wrote a proof that $f$ must be piecewise continuous. However, this proof must be incorrect according to Jahan's answer. Where's the problem?

Suppose $f$ is not piecewise continuous. Then the collection $X$ of points $x\in[a,b]$ at which $f$ is discontinuous is infinite. For each $x_0\in X$ there exists $\epsilon>0$ such that in every neighborhood of $x_0$ there is an $x$ satisfying $|f(x_0)-f(x)|\ge \epsilon$. Suppose $f_n$ is continuous at $x_0$. Then there exists $\delta>0$ such that when $|x-x_0|<\delta$ we have $|f_n(x)-f_n(x_0)|<\epsilon/3$. Since $f_n\rightrightarrows f$, there is some $N$ such that for all $n\ge N$ and all $x\in[a,b]$ we have $|f_n(x)-f(x)|<\epsilon/3$. Now, for $n\ge N$ we have that $$\epsilon\le |f(x)-f(x_0)|\le |f(x)-f_n(x)|+|f_n(x)-f_n(x_0)|+|f_n(x_0)-f(x_0)|<\epsilon.$$
This is a contradiction. Therefore, for each $x_0$ in $X$, $f_n$ is not continuous at $x_0$ and so its set of discontinuity points is infinite. Therefore $f$ must be piecewise continuous, else some function in the sequence is not piecewise continuous.

Best Answer

Let $f_0$ be a constant function, say $f_0(x)=0$. I'll tell you how to generaete a sequence of functions whose uniform limit isn't piecewise continuous.

From $f_{n-1}$, we'll construct $f_{n}$ in the following manner: Divide your interval $[a,b]$ up evenly into $2^n$ pieces. Starting at the leftmost piece, alternatively raise/lower $f_{n-1}$ by $\frac{1}{2^n}$ in each interval. This new function is $f_n$. You should be able to convince yourself that this function converges uniformly, since $\sup(f_m-f_n)\leq 2\max(\frac{1}{2^n},\frac{1}{2^m})$. You should also be able to convince yourself that the limiting function is discontinuous at every point of the form $a+\frac{(b-a)}{2^n}$.

Essentially, the displacements never "cancel" (i.e., if you raise the function on the left of a point and lower the function on the right of the point, you do the same every subsequent iteration. You'll never lower the function on the right and raise the function on the left). Thus, the function is discontinuous at every point where you broke it apart.