Consider the Cantor set $2^\omega$ of infinite binary strings, and we define metric/distance as $x, y \in 2^\omega,\; d(x, y) = 2^{-k}$ where $k$ is the longest common prefix of $x$ and $y$.
Question 1. Consider some function $F(x) : 2^\omega \rightarrow R$. If $F(x)$ satisfies both 1) and 2):
1) $F(x) = 0$ for any $x$ that ends in a cycle of $0$s (e.g. $x = \overline{0}$ or $x = 01101\overline{0}$)
2) $F(x) = 1$ for any $x$ that ends in a cycle of $1$s (e.g. $x = \overline{1}$ or $x = 01100\overline{1}$)
then, is $F(x)$ necessarily nowhere continuous on $2^\omega$?
I think the answer is yes: because for any $x \in 2^\omega$, and any neighborhood of radius $r$ (i.e. the set of strings that shares a common prefix of length $-\log_2 (r)$ with $x$), we can always find $x'$ and $x''$ in the neighborbood where $x'$ ends in $0$s and $x''$ ends in $1$s, and thus either $|F(x) - F(x')|$ or $|F(x) - F(x'')|$ cannot have an upperbound by $\epsilon$.
If the answer to Question 1 is false, then ignore Question 2.
Question 2. Consider the function $f_p(x) : 2^\omega \rightarrow R$, parametrized by $p$ where $0 < p < 1$: $f_p(x) = p \cdot \sum_{i=0}^{\infty} (1-p)^i x_i$ where $x_i$ is the $i$-th digit of $x$.
If we take the pointwise limit of $f_p(x)$, $$ \newcommand\defeq{\stackrel{\mbox{def}}{=}} \lim_{p \rightarrow 0} f_p(x) \;\defeq\; \hat{F}(x) $$ I think that $\hat{F}$ satisfies both 1) and 2):
First notice that $\forall 0 < p < 1, 0 \le f_p(x) \le 1$.
a) For any $x$ that ends in a cycle of $0$s after an arbitrary prefix of length $L$: $$ p \sum_{i=0}^{\infty} (1-p)^i \cdot x_i = p \sum_{i=0}^{L} (1-p)^i \cdot x_i \le p \sum_{i=0}^{L} (1-p)^i = 1-(1-p)^{L+1} $$ $$ \implies 0 \le \hat{F}(x) \le \lim_{p\rightarrow 0} 1-(1-p)^{L+1} = 0 \implies \hat{F}(x) = 0 $$
b) For any $x$ that ends in a cycle of $1$s after an arbitrary prefix of length $L$: $$ p \sum_{i=0}^{\infty} (1-p)^i \cdot x_i \ge p \sum_{i=L}^{\infty} (1-p)^i \cdot x_i = (1-p)^L $$ $$ \implies 1 \ge \hat{F}(x) \ge \lim_{p\rightarrow 0} (1-p)^{L} = 1 \implies \hat{F}(x) = 1 $$
However, I think $f_p(x)$ is continuous on $x \in 2^\omega$, and therefore $\hat{F}(x)$ by definition is a Baire Class 1 function. According to Wikipedia on Baire class 1
By another theorem of Baire, for every Baire-1 function the points of continuity are a comeager Gδ set (Kechris 1995, Theorem (24.14)).
It seems that $\hat{F}$ cannot be nowhere continuous, which contradicts answer to Question 1 (if answer to Q1 is true, that is)?
Could someone help me figure out which step of my reasoning is wrong?
I have figured out the puzzle with help from a colleague.
The problem was that there are some $x$ such that the limit $ \lim_{p \rightarrow 0} f_p(x) $ does not exist (therefore $\hat{F}$ is not completely defined on $2^\omega$).
One example where the limit does not exist was $$x = \underbrace{0}_{u_1}\;\underbrace{11}_{u_2}\;\underbrace{000000}_{u_3}\;\underbrace{1...1}_{u_4}...$$ where $u_i = i!$.
Though I was not able to rigorously prove that this limit for this $x$ doesn't exist, I was able to plot $f_p(x)$ and pretty confident that it diverges.
It would be nice if someone can formally prove that the limit doesn't exist.
plot of $f_p(x)$, horizontal axis is $\ln(p)$