A question from Introduction to Analysis by Arthur Mattuck:
Let $f_n(x)=\begin{cases}1, & \text{if $x$ can be written $i/2^n$ for some integer $i$;} \\0, & \text{otherwise.} \end{cases}$
Answer the following, with proofs.
(a) Let $f(x)=\lim f_n(x).$ What is $f(x)$ explicitly ?
(b) Is the convergence $f_n \to f$ uniform on $I=[0,1]$?
(c) Is $f_n$ Riemann-integrable? Is $f$ ?
I am not sure what $f$ is.
Well, note that if $f_N(x_0)=1$ for some $N$, then also $f_n(x_0)=1$ for all $n>N$; so to get $f(x_0)=1$, we need some $N$ with $f_N(x_0)=1$. This essentially means,
Since $f$ only takes values $0$ and $1$, we get
$$f(x)=\begin{cases}1, & \text{if $x$ can be written $i/2^n$ for some integers $i$ and $n$} \\0, & \text{otherwise.} \end{cases}$$
Do you see how this translates to uniform convergence? Do you think this can be integrated? What do you think the graph looks like?