If $f(x+1/n)$ converges to a continuous function $f(x)$ uniformly on $\mathbb{R}$, is $f(x)$ necessarily uniformly continuous? Suppose $f:\mathbb{R}\mapsto\mathbb{R}$ is a continuous function. Define $f_n(x)=f(x+1/n)$ for all $n\in\mathbb{N}^+$. If $f_n(x)\to f(x)$ uniformly on $\mathbb{R}$, can we conclude that $f$ is actually uniformly continuous? If not, can you give a counterexample of $f$ to be not uniformly continuous but satisfies all above conditions?
I know that if $f_n(x)$'s are all uniformly continuous and $f_n(x)\to f(x)$ uniformly, then $f(x)$ must be uniformly continuous. However, here we do not assume $f(x)$ to be uniformly continuous, and $f_n(x)$ has specific structure related to $f(x)$, so at least you cannot directly conclude they are uniformly continuous. I guess the statement above is wrong but it's hard for me to find a counter-example. Can anyone help me?
 A: 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.
A: By assumption, for every $\epsilon >0$, there is an $n_0 \in \Bbb N$ such that for every $x \in \Bbb R$
$$n \geq n_0 \implies \left| f(x) - f \left(x + \frac{1}{n} \right)  \right| < \epsilon$$Now if you repeatedly substitute $x = \pm \frac{1}{n}$ in the above inequality, we can conclude that for any two rationals $a,b$ of the form(say $*$-type) $\frac{m}{n}$, where $m,n \in \Bbb Z, n \geq n_0$, we have
$$|f(a)-f(b)| < \epsilon$$
Now observe that the rationals of the form $m,n \in \Bbb Z, 0<n < n_0$ are nowhere dense in $\Bbb R$. Therefore rationals of $*$-type are dense in $\Bbb R$(we are using the fact that the rationals are dense in $\Bbb R$). Since $f$ is continuous, we obtain that for any two real numbers $x,y$
$$|f(x)-f(y)| \leq \epsilon$$
But since $\epsilon$ was arbitrary, we can conclude that $f$ must be a constant function which is trivially uniformly continuous.
A: Yes, such an $f$ must be uniformly continuous
Suppose that the sequence $$f_n(x) := f(x + 1/n) \to f(x)$$ uniformly on $\Bbb{R}$. This means for any $\epsilon > 0$, there exists $N_\epsilon$ so that $|f(x + 1/n) - f(x)| < \epsilon$ for all $n \geq N_\epsilon$ and all $x \in \Bbb{R}$.
So fix $\epsilon > 0$, and let $N_k := N_{\epsilon/2^k}$. For any $x \in \Bbb{R}$, define sets $S_k(x)$ via
\begin{align*}
S_0(x) &:= \{ x \} \\
S_1(x) &:= S_0(x) \cup \{ x + 1/k_1: k \geq N_1 \} \\
S_2(x) &:= S_1(x) \cup \{ y_1 + 1/k_2: y_1 \in S_1, k_2 \geq N_2 \} \\
S_3(x) &:= S_2(x) \cup \{ y_2 + 1/k_3: y_2 \in S_2, k_3 \geq N_3 \} \\
\vdots \\
S_j(x) &:= S_{j-1}(x) \cup \{ y_{j-1} + 1/k_j: y_{j-1} \in S_{j-1}, k_j \geq N_j \} \\
\vdots \
\end{align*}
Clearly $S_j(x)$ is closed for all $j \geq 0$, every point in $S_{j-1}(x)$ is a limit point of $S_j(x)$, and if $y_j \in S_j(x)$ for $j \geq 1$, $$|f(y_j) - f(x)| < \epsilon(1 - 2^{-j}).$$ We want to show $$S_\infty(x) := \overline{\cup_{j = 0}^\infty S_j(x)}$$ contains some interval $[x, x + \delta)$ for $\delta > 0$, as this will establish uniform continuity of $f$. If $\sum_{k \geq 1} 1/N_k = \infty$, this is simple, so suppose $\sum_{k \geq 1} 1/N_k$ is convergent. WLOG we can assume $2 \leq N_1 \leq N_2 \leq ...$ Then a simple greedy algorithm establishes that if we set $$\delta = \frac{1}{N_1 N_2} + \frac{1}{N_1 N_2 N_3} + ...$$ then every number $y$ with $x < y \leq x + \delta$ can be written as a sum of the form $\sum_{j = 1}^\infty \frac{a_j}{m_j}$, where $a_j \in \{ 0, 1 \}$ and $m_j \geq N_j$ for each $j$. It follows that for such $y$, $|f(y) - f(x)| < \sum_{j = 1}^\infty \frac{\epsilon}{2^j} = \epsilon$. This establishes uniform continuity of $f$.
I haven't worked out the details, but I'm pretty sure you can use an analogous argument to establish that if $\{ a_n \}$ is any sequence converging to $0$ and $f_n(x) := f(x + a_n)$, then uniform convergence of the $f_n$ to $f$ is equivalent to uniform continuity of $f$.
