[Math] A sequence of continuous functions converging to a discontinuous function

real-analysissequences-and-series

Let $f:I\to \mathbb R$ be a function which is continuous in every points of the interval $I$ except of a finite number of discontinuities $c_1,…,c_n$. I would like to find a sequence of continuous functions $f_n:I\to \mathbb R$ such that $\lim f_n=f$ pointwise.

This question seems very difficult, maybe because this one is very general, I'm really stuck here, any help is welcome.

Thanks a lot

Best Answer

Take $$f:[0,1]\rightarrow \mathbb{R}\\ f(x)=\left\{\begin{array}{rl} 0 & x\neq 1 \\ 1 & x=1\\ \end{array}\right. $$ And $$f_n=x^n$$ With scaling and piecewise definitions you can to this one for any countable set of $c_1,\dots ,c_n$ In general our function will look like $$f(x)=\left\{ \begin{array}{rl} 0 & x \neq c_i \forall i\\ 1 & \text{else} \\ \end{array}\right.$$ On $[c_i,c_{i+1}]$ we gonna have something like $$f_{ni}(x)=\left(\frac{c_2-x}{c_2-c_1}\right)^n +\left(\frac{x-c_1}{c_2-c_1}\right)^n$$

And all together we will have (with $I=[a,b]$) $$f_n(x)=\left\{ \begin{array}{rl} 0 & x\in [a,c_0)\\ f_{ni} & x \in [c_i,c_{i+1})\\ 0& x\in [c_n,b] \\ \end{array}\right. $$

Edit for a given function the idea is the following, as you only have finite $c_i$ you take with $$\varepsilon=\min_{1\leq i \leq n-1} \{d(c_i,c_{i+1})\}$$ which is the shortest distance between two points of incontinuousity. Edit we don't need Stone Weierstraß at all sry.
$[c_i+\frac{\varepsilon}{2n},c_{i+1}-\frac{\varepsilon}{2n}]$ we just take $f$ on the intervalls (the uniform convergence is trivial). So we only need to chose a secquence of function on $[c_i-\frac{\varepsilon}{2n},c_i+\frac{\varepsilon}{2n}]$. We will call them $s_{ni}$ (like spline).
We chose $$s_{ni}(x)= \left\{ \begin{array}{rl} f(c_i) + \frac{f\left(c_i-\frac{\varepsilon}{2n}\right)-f(c_i)}{\frac{\varepsilon}{2n}} \cdot (x-c_i) & x-c_i \leq 0\\ f(c_i)+\frac{f\left(c_i+\frac{\varepsilon}{2n}\right)-f(c_i)}{\frac{\varepsilon}{2n}}\cdot (x-c_i) & x-c_i >0 \end{array}\right.$$ Ok that one looks really complicated but all i am saying we make a line from the left end to the point we want to have $f(c_i)$ and another one to get a continuous function in all the intervall.