Continuity/measurability of a complicated extension of a family of continuous functions Bonjour/bonsoir à tous et à toutes. 
I've two questions related to something on which I'm working. I've already tried to discuss about them elsewhere, but it hasn't been fruitful so far.
Edit (4 Dic 2011). Let me simplify the original text according to the comments of fedja and Michael Greinecker.
Let $\mathcal{X} \equiv (X,\mathcal{O}_X)$ and $\mathcal{Y} \equiv (Y,\mathcal{O}_Y)$ be topological spaces, $I \ne \emptyset$ an index set, $\{X_i\}_{i \in I}$ a chain of $(2^X, \subseteq)$ such that $\textstyle \bigcup_{ i \in I} X_i = X$ and $X_i$ is dense in $\mathcal{X}$ for all $i \in I$, $\{f_i\}_{i \in I}$ a family of continuous functions $(X_i, X_i \cap \mathcal{O}_X) \to \mathcal{Y}$ such that $f_j$ extends $f_i$, for $i,j \in I$, if $X_i \subseteq X_j$. Then, set $f := \textstyle\bigcup_{i \in I} f_i$ (identifying each $f_i$ with its graph). Now come the questions.

Question 1. Is $f$ a continuous function $(X, X \cap \mathcal{O}_X)
> \to \mathcal{Y}$?

I've some clues that the answer to Question 1 may be negative, but so far I wasn't able to find out any counterexample by myself. In any case, if the answer is really "No", it will make still sense to ask for the following:

Question 2. Is $f$ a Borel function $(X, \mathfrak{B}(X \cap
> \mathcal{O}_X)) \to (Y,
> \mathfrak{B}(\mathcal{O}_Y))$? Here,
  provided $(W,\mathcal{O}_W)$ is a
  topological space, I'm denoting by
  $\mathfrak{B}(\mathcal{O}_W)$ the
  Borel algebra on $W$ generated by the
  open sets of $\mathcal{O}_W$.

Partial results (updated to 6 Dec 2011). fedja proved below in the comments that the answer to Question 1 is affirmative if the topology of $Y$ is such that points can be separated from closed sets. On another hand, Yulia Kuznetsova showed that Q1 is false assuming that $\mathcal{X}$ is the interval $[0,1]$ (with its usual subspace topology) and $\mathcal{Y}$ is the Sierpiński space (here).
Thank you in advance for any hint.
 A: Look if this works as a counterexample to Q1: Let $Y=\{0,1\}$ be a two-point set such that 1 is open and 0 is not, and let $X=[0,1]$ in the usual topology. Let $X_i = [0,1] \setminus \{2^{-k}: k>i\}$. Put $f_i(0)=1$, $f_i(2^{-k})=0$ for all $k$, and $f_i(x)=1$ for other $x$. Then every $f_i$ is continuous but $f$ is not. Right?
A: Sorry if this doesn't work - but:
I think one can modify the example to yieald a non-measurable function. The task is to find such a chain $F_i$ that:
every $F_i$ is closed;
$E=\cup F_i$ is not Borel;
$X\setminus E$ is dense in $X$.
Then the counterexample will be given by $f_i|_{F_i}=0$, $f_i|_{X\setminus E}=1$ where $\{0,1\}$ is the Sierpinski space with 1 open.
This is most easily constructed in a non-metrizable dyadic space: $X=\{0,1\}^A$ (where $\{0,1\}$ is a Hausdorff two-point set), $A$ is uncountable. Split $A=\cup_{i\in S} A_i$ into a noncountable disjoint union of subsets $A_i$, every $A_i$ being infinite and countable. For $B\subset A$, let $p_B:X\to \{0,1\}^B$ be the natural projection. On $S$, choose a linear order without a maximal element. For every $i\in S$, put $F_i = \{ x\in X: p_{A_k}(x)=0 \forall k\ge i\}$.
If $E=\cup F_i$, then clearly $X\setminus E$ is dense. I realize also that $E$ is not Baire, but I cannot say whether it is Borel.
