I'm working on series and sequences of functions by my own. Specifically, pointwise and unofrm convergence, and some examples using Taylor series. One of the exercises stated the next question:
"For every integer $k$, let $u_k=\begin{cases} 1, & \text{if $x\in$ [k,k+1)} \\ 0, & \text{otherwise} \end{cases}$
Find $f(x)=\sum_{0}^\infty u_k(x)$, and show directly from the definition that the series converges uniformly on $[-R,R]$ for all $R>0$, but does not on $(-\infty,\infty)$".
Normally, I was expecting to find $f(x)=Lim f_n(x_0)$ as $n \to \infty$ on the corresponding $I=[-R,R]$ and finally to show that $|f(x)-f(x_0)|<\varepsilon$
However, for finding the correspondent function I had problems and second, how to prove it. I dunno how is gonna be the functional form. As uniform convergence needs to be proved, I guess the resulting $n$ will not depend on $x$ and only on $\varepsilon$. Any advice will be helpful.
If we're are summing for $k\ge 0$ then @i707107 is slightly off as well. the function $f$ is $$f(x)= \left\{ \begin{array}{ccc} 0&\mathrm {if}& x<0\\ 2&\mathrm {if}& x\in \mathbb Z\cap(0,\infty)\\ 1 &&\mathrm {O.W.}\end{array} \right.$$ Other than that @i707107 is right. Let $N:= \lceil R\rceil$ then for $n\ge N$, we have $|f_n(x)-f(x)|<\varepsilon$. I was mixing up uniformly continuous with uniformly convergent.
While $N$ is independent of $x$, $N$ isn't independent of $R$. This is why $f_n(x) \rightarrow f$ isn't uniform for $(-\infty,\infty)$. Another way to put this is that there doesn't exist an $N\in \mathbb N$ such that $N>\infty$. Therefore we can't find an $N$ large enough such that $|f_n(x)-f(x)|<\varepsilon$ for every $x\in (-\infty,\infty)$. FYI this is more of the concept rather than a strict proof. That I leave to the OP.