If $f(x+1/n)$ converges to a continuous function $f(x)$ uniformly on $\mathbb{R}$, is $f(x)$ necessarily uniformly continuous?
Solution 1:
Updated answer:
No, $f$ need not be uniformly continuous, as shown by the example below. The example is tailored to the sequence $\{1/n\}_{n \in \mathbb{N}}$, and does not shed light on the general question of whether the condition that $f(x + \epsilon_n) \to f(x)$ uniformly implies that $f$ is uniformly continuous, for a given sequence $\{\varepsilon_n\}$ converging to zero.
First, define a sequence recursively by $a_1 = 3$ and $a_{n+1} = (a_n)!$ for $n \geq 1$. Let $h$ be the periodic function with period $1$ such that $h(x) = 2x$ for $x \in [0, 1/2]$ and $h(x) = 2-2x$ for $x \in [1/2, 1]$. In particular, $h(k) = 0$ for each integer $k$, and $h$ is continuous and Lipschitz with constant $2$. Now using the sequence, for each $n$ we define the function $g_n$ by $$g_n(x) = \begin{cases} 0 & x < n \\ \frac{1}{n} h(a_n x) & x \geq n\end{cases}$$ so $g_n$ is continuous and Lipschitz with constant $2a_n/n$. Finally, define $f(x) = \sum_{n=1}^\infty g_n(x)$, where $f$ is continuous since each $g_n$ is continuous, and all but finitely many $g_n$ vanish on $(-\infty, b)$ for each $b$.
We will now show that $f_m \to f$ uniformly, where $f_m(x) = f(x + 1/m)$. Fix $m$, and let $k$ be the smallest index such that $a_k \geq m$. In particular, this means that $m$ divides $a_n$ for all $n \geq k+1$, and thus for each such $n$, $1/m$ is a multiple of $1/a_n$, so $g_n(x + 1/m) = g_n(x)$ for all $x$ not in $(n-1, n)$. Therefore for any $x$, there is at most one $n \geq k+1$ for which $g_n(x + 1/m) \neq g_n(x)$, and this $n$ necessarily satisfies $|g_n(x + 1/m) - g_n(x)| \leq \frac{1}{n} \leq \frac{1}{k}$. It follows that for sufficiently large $m$ we have
\begin{align*} |f(x + 1/m) - f(x)| &= \left|\sum_{n=1}^\infty g_n(x + 1/m) - g_n(x)\right| \\ &\leq \frac{1}{k} + \sum_{n=1}^k |g_n(x + 1/m) - g_n(x)| \\ &\leq \frac{1}{k} + \frac{1}{k} + \frac{1}{k-1} + \sum_{n=1}^{k-2} |g_n(x + 1/m) - g_n(x)| \\ &\leq \frac{4}{k} + \sum_{n=1}^{k-2} \frac{2a_n}{n} \cdot \frac{1}{m} \\ &\leq \frac{4}{k} + \frac{2ka_{k-2}}{m} \\ &\leq \frac{5}{k} \end{align*} where the last inequality follows from $m \geq a_{k-1} \geq 2k^2 a_{k-2}$, which clearly holds for sufficiently large $k$. Then if we define $k_m$ to be the smallest $k$ for which $a_k \geq m$, we see that $k_m \to \infty$ as $m \to \infty$, so since $|f(x + 1/m) - f(x)| \leq 5/k_m$ uniformly for sufficiently large $m$, it follows that $f(x + 1/m)$ converges to $f(x)$ uniformly.
However, $f$ is not uniformly continuous. Note that $\int_0^1 h(a_nx) \,dx = 1/2$, so for any positive integer $k$, $\int_0^1 f(k + x) \,dx = \frac{1}{2}\sum_{n=1}^k \frac{1}{n}$, and thus there is some $x_k \in (0, 1)$ with $f(k + x_k) \geq \frac{1}{2}\sum_{n=1}^k \frac{1}{n}$. On the other hand $f(k) = 0$ always. But if $f$ were uniformly continuous, there would be some $M$ for which $|f(x) - f(y)| \leq M$ whenever $|x - y| \leq 1$, which clearly does not hold, so $f$ cannot be uniformly continuous.
Original answer:
Too long for a comment:
Whatever the answer is, it might depend on the properties of the sequence $\{1/n\}_{n \in \mathbb{N}}$. Below is an example which shows that if we instead define $f_n(x) = f(x + 3^{-n})$, then the condition that $f_n \to f$ uniformly on $\mathbb{R}$ does not imply that $f$ is uniformly continuous. I was unable to construct a similar example for the sequence $\{1/n\}_{n \in \mathbb{N}}$.
Let $h(x)$ be the "triangle wave" function, such that $h(x)$ is periodic with period $1$ and has $h(x) = 2x$ for $x \in [0, 1/2]$ and $h(x) = 2 - 2x$ for $x \in [1/2, 1]$. In particular, $h$ is continuous and has $h(0) = h(1) = 0$, $h(1/2) = 1$, and $|h(x) - h(y)| \leq 2|x - y|$ for all $x, y$. Next, for each $n$, define $g_n(x)$ so that $g_n(x) = 0$ for $x < n$ and $g_n(x) = \frac{1}{n} h(3^n x)$ for $x \geq n$. With this definition, $g_n$ is continuous, and satisfies $|g_n(x) - g_n(y)| \leq \frac{2}{n} \cdot 3^n|x - y|$ for all $x, y$. Finally, define $f(x) = \sum_{n=1}^\infty g_n(x)$. Note $f$ is continuous since each $g_n$ is continuous, and all but finitely many $g_n$ vanish on $(-\infty, a)$ for each $a$.
Now we will show that $f_m \to f$ uniformly, where $f_m(x) = f(x + 3^{-m})$. For $n \geq m$, $g_n(x + 3^{-m}) = g_n(x)$ so long as $x \not \in (n - 3^{-m}, n)$, meaning $g_n(x + 3^{-m}) \neq g_n(x)$ only in $(n-1, n)$. Thus for any $x$, there is at most one $n$ with $n \geq m$ and $g_n(x + 3^{-m}) \neq g_n(x)$, and this $n$ necessarily satisfies $|g_n(x + 3^{-m}) - g_n(x)| \leq \frac{1}{n} \leq \frac{1}{m}$. Thus we have \begin{align*} |f(x + 3^{-m}) - f(x)| &= \left| \sum_{n=1}^\infty (g_n(x + 3^{-m}) - g_n(x)) \right| \\ &\leq \frac{1}{m} + \sum_{n=1}^{m-1} |g_n(x + 3^{-m}) - g_n(x)| \\ &\leq \frac{1}{m} + \sum_{n=1}^{m-1} \frac{2}{n} \cdot 3^{-(m - n)} \\ &\leq \frac{C}{m} \end{align*} for some sufficiently large $C$ not depending on $m$. Thus $|f_m - f| \leq C/m$, so $f_m \to f$ uniformly.
On the other hand, $f$ is not uniformly continuous. Consider $x$ of the form $k + \frac{1}{2}$ for $k$ a positive integer. For $n \leq k$ we have $g_n(x) = \frac{1}{n}$ since $3^n x = 1/2$ modulo $1$, so $f(k + \frac{1}{2}) = \sum_{n=1}^k \frac{1}{n}$. In particular, letting $k \to \infty$ we see $f(k + \frac{1}{2}) \to \infty$, while $f(k) = 0$ always, so $f$ is not uniformly continuous.