question about existence of function $f:\mathbb{R} \to \mathbb{R}$ such $f$ is not the pointwise limit of a sequence of continuous functions so i have question about existence of function $f:\mathbb{R} \to \mathbb{R}$ such $f$ is not the pointwise limit of a sequence of continuous functions $\mathbb{R} \to \mathbb{R}$.
i'm created a family of continuous functions $k_i:\mathbb{R} \to \mathbb{R}$ for any function $f:\mathbb{R} \to \mathbb{R}$ such that $\lim_{n \to \infty} k_n(x)=f(x)$ , how ever i am pretty sure my construction have a flaw in it but i could not understand why it's wrong can some one tell me what am i doing wrong , because it seems very unrealistic to be able to do it for any $f$.
here is my construction steps:
1.pick any arbitrary $x,y \in \mathbb{R}$ such $x<y$ , and connect $f(x)$ to $f(y)$.
2.pick any arbitrary $z \in \mathbb{R}-\{x,y\}$ , if $f(y)<f(z)$ connect $f(z)$ to $f(y)$ and if $f(z)<f(x)$ connect $f(z)$ to $f(x)$, if $f(x)<f(z)<f(y)$ , connect $f(x)$ to $f(z)$ and $f(z)$ to $f(y)$.
now we are again doing this uncountable times with other elemnts in $\mathbb{R}-\{x,y,z\}$ and do the step 2 for that element over all choosed elements by uncountable number of comparisions (after uncountable number of iteration we will have uncountable number of picked elements of $\mathbb{R}$).
call set of picked elements $S$, when we pick an other element from $\mathbb{R}-S$ , like $t$ we will consider $ x_1= \max \{ x ; x \in S \land x<t \}$ and $x_2 = \min \{ x ; x \in S \land x>t \}$ and we connect $f(x_1)$ to $f(t)$ and then $f(t)$ to $f(x_2)$ and call all the connected line with $S \cup {t}$ function $k_t$. we will do this uncountable number of times.
i'm pretty sure there is a flaw in my argument , but can you please help me to find it.i really appreciate your kindness and support.
 A: Pointwise limit of continuous functions cannot be arbitrary.
For example, if $f$ is such a limit, then $f^{-1}(O)$ is a $F_\sigma$ set (i.e., countable union of closed sets)
for any open subset $O$ of $\mathbb{R}$.
You may be able to get some idea from my old post.
$f_n\rightarrow f$ pointwise, $O$ open subset of $\mathbb{R}$ $\Rightarrow$ $f^{-1}(O)$ is $F_{\sigma}$
In particular, pick any non $F_\sigma$ set $A$ and define $f=1_A$, then $f$ cannot be a pointwise limit of continuous functions.
A: OP's argument seems to have too many holes/gaps to complete easily. But there is a simple solution.
Keep in mind that the pointwise limit of measurable functions is measurable. And also keep in mind that all continuous functions are measurable.
Therefore, we just need a function that is not measurable.
To achieve this, take some set which is not Lebesgue measurable (a Vitali set, for example). Then, take its characteristic function. This function will not be measurable.
A: There are multiple problems with your argument.
First: "Connect $f(x_1)$ and $f(x_2)$." Okay... and what exactly is the function you are defining? Presumably it is  supposed to be a function defined on all of $\mathbb{R}$. What is this function? You don't say.
Next: Presumably, you have defined a continuous function $k_S$ associated to the set $S$, and which satisfies $k_S(x)=f(x)$ for all $x\in S$. Fine, let us say that is the case. If $S\neq\mathbb{R}$, you now want to extend $S$ to a larger set $S'=S\cup t$ (with $t\in \mathbb{R}-S$) by looking at
$x_1=\max\{x\in S\mid x\lt t\}$  and $x_2=\min\{x\in S\mid x\gt t\}$.
How do you know these sets have a maximum and a minimum? You don't even know if they are nonempty. But in any case, you don't know that, if nonempty, then they have a maximum and a minimum. The best you would be able to say is that they have a supremum and and an infimum (which then need not be in $S$). You say "connect $f(x_1)$ and $f(t)$".... again, what is the function you are defining? You have your $k_S$; are you presumably modifying $k_S$ in some way so that now you have a function $k_{S'}$ which agrees with $f$ on all of $S'$. But you don't actually say what it is you are doing.
I expect/suspect/guess that you want to define $k_{S'}$ to be equal to $k_S$ on $(-\infty,x_1)\cup (x_2,\infty)$, and then define it to be the straight line from $(x_1,f(x_1)$ to $(t,f(t))$ to $(x_2,f(x_2))$ on $[x_1,x_2]$. But what if $x_1=x_2$? That's  possible if you  need to use suprema and infima rather than max and min. In that case, you don't get to re-define $k_S$ at $t$, so you won't be able to define $k_{S'}$ to agree on all of $S'$ with $f$. That's going to mess you up if $S$ is infinite.
Now, you recongize that you can't stop at finite $S$. Because $\mathbb{R}$ is not countable, you are going to need to do some kind of "transfinite induction". Transfinite induction requires you to show that if you have defined the process at all steps $\alpha\lt \gamma$, then you can define it at $\gamma$. That means you need to tell me how to define $k_S$ at the $\omega$ step.
If you've defined sets $S_1\subseteq S_2\subseteq S_3\subseteq\cdots$... and you take $S_{\omega}=\cup_{i=1}^{\infty} S_n$.... what is the function you take here? You would presumably take the limit of $k_1,k_2,\ldots$... but then how do you know it is continuous?  We know the pointwise limit of continuous functions doesn't have to be continuous. So how do we define the $\omega$th  function?
Even assuming you do manage to figure out what do in that infinite set, then you're going to run into your next problem, the one noted above: your description does not allow you to  guarantee that you can define "the next function" once $S$ is infinite (assuming you ever got around to actually defining the functions you are supposed to be defining, which you haven't done yet).
Finally, let us assume for the sake of argument that you somehow managed to complete this process and obtained a collection of sets $S_{\alpha}$, indexed by ordinals, with $S_{\alpha}\subseteq S_{\beta}$ whenever $\alpha\leq \beta$, and with $\cup S_{\alpha}=\mathbb{R}$. So that you have a family of functions $k_{\alpha}$ that are continuous and such that $k_{\alpha}$ agrees with $f$ on $S_{\alpha}$.
Now, you are trying to come up with a sequence of functions that converges to $f$ pointwise. By definition a sequence is a function with domain $\mathbb{N}$ (or $\omega$, if you want to do ordinals). So maybe you think "I'll just pick larger and larger $\alpha$, but only countably many of them, with union equal to the union of all of them". This is called a "cofinal set": given a (partially) ordered set $P$, a subset $C$ of $P$ is "cofinal in $P$" if for every $p\in P$  there exists a $c\in C$ such that $p\leq c$. If you could find a cofinal set among your indices with cardinality $\aleph_0$, you could perhaps use that to get your sequence...
Alas, that's also impossible. Even though in ZFC we do not know exactly what the cardinality of $\mathbb{R}$ is (as an ordinal/cardinal; we know it is $2^{\aleph_0}$, but we don't know exactly which aleph that is), there is one thing we definitely know: that cardinality does not have a cofinal set of cardinality $\aleph_0$. This is a consequence of König's Theorem. So even if you somehow were able to get this "uncountable bunch of continuous functions", indexed by ordinals going all the way to $\mathbb{R}$, with pointwise "limit" equal to $f(x)$, you would still be out of luck because you would not be able to extract from this a sequence converging pointwise to $f$.
In summary:

*

*You never actually defined the functions you want at each step.

*Even if you do define them at the finite steps, you don't say how to get beyond the finite steps to the $\omega$ step.

*Even if you do define it at the $\omega$ step, your method is not guaranteed to work one you have taken infinitely many steps.

*Even if you do manage to guarantee it works at  the infinite steps, in the end you cannot find a countable collection of these functions that will work.

