# show that if $\lim (f(x_1)+\cdots +f(x_n))/n$ exists whenever $\lim (x_1+\cdots +x_n)/n$ exists, then $f$ is continuous

Show that if $$f:[0,1]\to \mathbb{R}$$ and$$\lim \limits _{n\to \infty}\frac{f(x_1)+\cdots + f(x_n)}{n}$$exists whenever$$\lim \limits _{n\to \infty}\frac{x_1+\cdots + x_n}{n}$$exists, where $$(x_n)$$ is a sequence of real numbers, then $$f$$ is continuous.

It suffices to show that if $$x_n\to x$$, then $$f(x_n)\to f(x)$$. It might be useful to show this via a contradiction; suppose there is a sequence $$x_n$$ so that $$x_n\to x\in \mathbb{R}$$ but $$f(x_n)\not \to f(x)$$. We know that $$\dfrac{f(x_1)+\cdots +f(x_n)}n$$ exists and equals $$L$$, say. By definition, there exists $$\varepsilon >0$$ so that for all $$N$$, $$\exists n\geq N$$ such that $$|f(x_n)-f(x)|\geq \varepsilon$$. But I'm not sure how to get a contradiction from here.

• $(f(x_1)+\cdots + f(x_n))/n$ and $(x_1+\cdots + x_n)/n$ always exist (unless $n=0$.) Is there a $\lim$ missing somewhere? Aug 5, 2022 at 22:05
• @JairTaylor yes. Aug 5, 2022 at 22:51

Let $$x_n \to x$$

$$L := \liminf\limits_{n\to\infty} f\left(x_n\right)$$

There is an increasing sequence of integers $$\left(\ell_p\right)_p$$ such that $$\lim_{p\to\infty} f\left(x_{\ell_p}\right) = L$$

I will assume that $$-\infty , Using the fact that:

$$\forall m\in \Bbb N;\; \lim_{n\to\infty} \frac{1}{n+m}\left(\sum_{k=1}^n f\left(x_{\ell_k}\right)+ mf(x)\right) = L$$ and $$\forall n\in \Bbb N;\; \lim_{m\to\infty} \frac{1}{n+m}\left(\sum_{k=1}^n f\left(x_{\ell_k}\right)+ mf(x)\right) = f(x)$$

you can easily construct (by induction) two increasing sequences of integers $$\left(m_p\right)_{p\in \Bbb N}$$, $$\left(n_p\right)_{p\in \Bbb N}$$, such that $$m_0= n_0 = 0$$ and

• $$\forall p\in\Bbb N_{\ge 1},$$
$$\left|\frac1{n_{p}+m_p}\left(\sum_{k=1}^{n_{p}} f\left(x_{\ell_k}\right) + m_pf(x)\right) - f(x)\right| < \frac1{p};$$ and $$\left|\frac1{n_{p+1}+m_p}\left(\sum_{k=1}^{n_{p+1}} f\left(x_{\ell_k}\right) + m_pf(x)\right) - L\right| < \frac1{p}$$

Let $$z_k = \begin{cases}x_{\ell_{k-m_p}} & \text{if n_p+m_p < k \le n_{p+1}+m_p}\\ x & \text{if n_{p+1} + m_p < k \le n_{p+1} + m_{p+1}}\end{cases}$$

So $$\limsup_{k\to \infty}\left|z_k-x\right|\le \limsup_{k\to \infty} \left|x_{\ell_k}-x\right| = 0$$

This proves that: $$\lim\limits_{k\to\infty} z_k = x$$, So $$\lim_{n\to\infty} \frac1n \sum_{k=1}^n f\left(z_k\right)$$ exists. On the other hand $$\frac1{n_p + m_p}\sum_{k=1}^{n_p+m_p}f(z_k) = \frac1{n_{p}+m_p}\left(\sum_{k=1}^{n_{p}} f\left(x_{\ell_k}\right) + m_pf(x)\right) \underset {p\to \infty} \to f(x)$$

and $$\frac1{n_{p+1} + m_p}\sum_{k=1}^{n_{p+1}+m_p}f(z_k) = \frac1{n_{p+1}+m_p}\left(\sum_{k=1}^{n_{p+1}} f\left(x_{\ell_k}\right) + m_pf(x)\right) \underset {p\to \infty} \to L$$

By unicity of the limit $$L=f(x)$$. By doing the same thing for the $$\limsup$$, you have $$f(x) = \liminf_{n\to\infty} f\left(x_n\right) = \limsup_{n\to \infty} f\left(x_n\right).$$

First show that if $$x_n\rightarrow x$$, then $$\frac{\sum_{i=1}^n x_i}{n}\rightarrow x$$ (and if $$0\le x_n \le 1$$, so is $$0\le\frac{\sum_{i=1}^n x_i}{n}\le1$$, we don't have to worry about the domain at all).

Now by the condition, $$a:=\lim\frac{\sum_{i=1}^n f(x_i)}{n}$$ exists. If $$f(x)\not=a$$, then the strategy is clear: Adding any number of $$x$$ to $$x_n$$ to create $$\{y_i\}$$ won't change the fact that the average $$\frac{\sum_{i=1}^ny_i}{n}$$ still converges, but it would make the average $$\frac{\sum_{i=1}^n y_i}{n}$$ oscillate around $$a$$ and $$f(x)$$.

To be more specific, first we pick $$y_1=x_1, \cdots, y_n=x_n$$ such that $$\frac{\sum_{i=1}^n y_i}{n}$$ is very close to $$a$$, now we set $$y_{n+1}=\cdots = y_m = x$$ for sufficiently large $$m$$ to bring the average close to $$f(x)$$, and then back to set $$y_{m+1}=x_{n+1}, \cdots$$ to bring the average once again close to $$a$$, and so on.

This shows $$f(x) = \lim \frac{\sum_{i=1}^n f(x_i)}{n}$$. Now if $$f(x_n)$$ doesn't converge to $$f(x)$$, we may use similar strategy to pick a subsequence such that the average oscillate.

• I don't understand this argument. If you replace any number of $x_n$'s with $x,$ the average $\dfrac{\sum_{i=1}^n y_i}n$ will converge to $x$. Why does the average oscillate around a and f(x)? Aug 6, 2022 at 0:11
• @Gord452, not to replace any of the $x_n$, but to add bunch of $x$ into the sequence in certain places, so the average occillates. Aug 6, 2022 at 0:23
• yeah it needs a lot more rigor as the other answer demonstrates. Aug 6, 2022 at 3:10