Continuous function with infinitely many zeros

This starts with a description of an answer, and then drills down to details. This question is more interesting than many.

The original question's answer seems to be "no".

One can construct, inductively, a sequence of intervals $I_k=[a_k,a_{k+1}]$ (with $a_k$ increasing to $1$), and values for $f$ on $I_k$, and a sequence of $n_k\to\infty$, so that the value of $\int_0^1 \exp(n_kx)f(x)dx$ is pretty much determined by the values of $f$ on $[0,a_k]=I_0\cup I_1\cup \cdots\cup I_{k-1}$ and not affected much by subsequent tinkerings of $f$ on $[a_{k},1]=I_{k}\cup\cdots$. This can be done in such a way that $f$ is continuous and $|f(x)|\le1-x$ for all $x$. As EricWofsey comments, in effect, one can choose $a_{k+1}$ so large (that is, close to $1$) that $(1-a_{k+1})\exp(n_k)$ is as small as you want.

The upshot is a continuous $f$ such that $$\liminf_{k\to\infty}\quad (-1)^k \int_0^1 \exp(n_k x) f(x)dx = 1,$$ disproving the original conjecture.

Overall the construction I am describing is like the standard examples of bounded sequences without Cesaro averages. You know, 10 zeros followed by 100 ones followed by 1000 zeros followed by 10000 ones...

Now for some details. I apologize for the intricate notation. It is possible I have made a typo somewhere. It is more than possible that there is a simpler way to arrange the calculation or (better yet) a simpler way to see the result.

Let $\Lambda_\alpha(x)=\max(0,\alpha/2-|2x-(\alpha+1)|)$ be the piecewise linear function whose graph has an isosceles triangular spike centered at $(1+\alpha)/2$, of width $\alpha/2$ and height $\alpha/2$. Note that $\text{supp } \Lambda_\alpha = [(3\alpha+1)/4,(\alpha+3)/4]$, and that $|\Lambda_\alpha(x)|\le |1-x|$. The final form of $f$ will be $$f(x)=\sum_{k\ge0} \epsilon_k (-1)^k \Lambda_{a_k}(x),$$ where the $\epsilon_k$ are in $[0,1]$. The function $f$ satisfies $|f(x)|\le|1-x|$ on $[0,1]$.

We will construct $a_k, n_k, \epsilon_k$ inductively.

At stage $k$ we will have specified $f$ on the interval $[0,a_k]$, and the inductive step delivers a formula for $f$ on the interval $I_k=[a_k,a_{k+1}]$, thus extending the definition of $f$ to $[0,a_{k+1}]$.

Start with $k=0$ and $a_0=0$. Let $L>0$ be a constant, such as $L=1$.

At inductive stage $k$, chose $n$ so large that $0<\epsilon_k<1$, where $$\epsilon_k = \frac { L - (-1)^k\int_0^{a_k}f(x)e^{nx}dx}{\int_0^1\Lambda_{a_k}(x)e^{nx}dx},$$ and, if $k>0$, also $n\ge1+n_{k-1}$. This is possible because the integral in the denominator has larger exponential growth rate (at least $(3a_k+1)/4$) than that in the numerator, which is at most $a_k$. Denote the chosen $n$ by $n_k$. Finally, and this is the key point identified by EricWofsey in a comment, chose to be very close to $1$, as in $$a_{k+1} = \max((a_k+3)/4, 1-\exp(-2n_k)).$$ Note $a_{k+1}<1$.

The restriction of $f$ to $I_k=[a_k,a_{k+1}]$ is $(-1)^k\epsilon_k\Lambda_{a_k}$.

It is easy to see from this that $n_k\to\infty$ and that $a_k\to 1$. Checking that $f$ is continuous is routine.

By construction, $\int_0^{a_{k+1}}f(x)e^{n_kx}dx = (-1)^k L$ and this differs from $\int_0^1 f(x) e^{n_kx}dx$ by $\int_{a_{k+1}}^1 \exp(n_k)dx = O(\exp(-n_k))$.