Does pointwise or uniform convergence of functions preserves intermediate value property? 
Problem. Let $f_n,f:A(\subseteq\mathbb{R})\to\mathbb{R}$ such that $(f_n)_{n\in\mathbb{N}}$ converges pointwise to $f$ and $f_n$ satisfies the intermediate value property for all $n\in\mathbb{N}$. Does $f$ also satisfy the intermediate value property? Would your conclusion be same if the convergence of $(f_n)_{n\in\mathbb{N}}$ to $f$ were uniform? 

What I observed was that if $t\in A$ and $f_n(r_n)=t$ for all $n\in\mathbb{N}$ then we will be done if we assume that for all sequence $(x_n)_{n\in\mathbb{N}}\in A$, if $(x_n)_{n\in\mathbb{N}}$ converges to $x$ then  $\bigl(f_n(x_n)\bigr)_{n\in\mathbb{N}}$ converges to $f(x)$. But obviously, this doesn't prove (or disprove) the problem.
Can anyone help?
 A: Counterexample
Suppose $A = [-1,0)\cup(0,1].$ For $x \in A,$ define $f(x) = x.$ Because the value $0$ is not in the range of $f,$ $f$ does not have the IVP on $A.$
For $n=1,2,\dots$ define $f_n(x) = x$ except on $[-1/n,0),$ where we want $f_n$ to equal $0$ near and to the left of $0.$ So on $[-1/n,-1/2n]$ define $f_n(x) = -1/n +2(x+1/n).$ Then set $f_n = 0$ on $[-1/2n,0).$ (This is simple, but it's good to draw a picture.) Observe that each $f_n$ has the IVP on $A.$
Since $|f_n-f| \le 1/n$ on $A,$ $f_n \to f $ uniformly on $A.$ So we have a counterexample. Note that it was important that $A$ not be connected.

Now let's consider a connected $A,$ say $A=\mathbb R.$ If we want a counterexample, then obviously the limit function can't be continuous. But it can't have a simple discontinuity either. Why? If you scratch around a bit, you'll see that near the point of discontinuity $f_n$ can't have the IVP for large $n.$ So the limit function must have a discontinuity of the wilder sort; things like $\sin(1/x)$ come to mind, but I couldn't get anywhere with that. So I decided to go really wild:

Theorem. There exists $f:\mathbb R \to \mathbb R$ with the property that if $I$ is any nonempty open interval, then $f^{-1}(\{y\})\cap I$ is uncountable for every $y\in \mathbb R.$

OK, that's a beast there, something you wouldn't want to take home to meet your parents. I'll leave the proof of that for now.
Now the $f$ in the theorem has the IVP, big time, but if we modify it just a bit, it will fail to have the IVP. Let $Z_f$ be the subset of $\mathbb R$ where $f=0.$ Simply define $g = 1$ on $Z_f,$ $g = f$ elsewhere. Then $g:\mathbb R \to \mathbb R\setminus \{0\}$ and if $I$ is any nonempty open interval, then $g^{-1}(\{y\})\cap I$ is uncountable for every $y\in \mathbb R\setminus \{0\}.$ It is clear that $g$ fails to have the IVP on each $I:$ There will exist $a,b\in I$ such that $g(a) <0, g(b)>0,$ but no point of $I$ where $g=0.$
For $n\in \mathbb N,$ note that $\{g=1/n\}$ has a countable dense subset $D_n.$ Define $g_n = 0$ on $D_n,$ $g_n=g$ everywhere else. Then $\sup_\mathbb R |g_n-g| = \sup_{D_n} |g_n-g| = |0-1/n| = 1/n.$ Therefore $g_n \to g$ uniformly on $\mathbb R.$
Claim. Each $g_n$ has the $IVP.$ 
Proof. Let $I$ be a nonempty open interval. It's enough to show $g_n(I) = \mathbb R.$ Now $g_n= g$ in $I \setminus \{g=1/n\}.$ Thus $g_n(I)$ contains every real number except, possibly, $0$ and/or $1/n.$ But $g_n=0$ on  $D_n\cap I,$ and since $\{g=1/n\}\cap I$ is nonempty, $D_n\cap I$ is nonempty by density. Thus $g_n =0$ somewhere in $I.$ But also we know $\{g=1/n\}\cap I$ is uncountable. Since $D_n$ is countable, $[\{g=1/n\}\setminus D_n]\cap I$ is uncountable. Thus $g_n = 1/n$ at uncountably many points of $I.$ This shows $g_n(I)=\mathbb R$ as desired, and finishes the proof.
A: See $f_n: [0,1] \to \mathbb{R}, x \mapsto x^n$ as a counterexample. It converges pointwise to $f(x) = \begin{cases} 0 & :x < 1 \\ 1 & :x = 1\end{cases}$, and $f$ obviously does not satisfy the intermediate value property.
What changes when $f_n$ converges uniformly?
