consider $x\in [0,\infty)$, $f(x)=\frac{1}{x+1}$,$g(x)=\sum_{n=0}^{\infty}(-1)^nf(nx)$,what is the maxium of $\liminf_{x\rightarrow 0^+}g(x)$?
What I have done:
it is easy to show $g(x)$ is continuous on $(0,\infty)$ because the sum convergence uniformly on $[\epsilon,\infty),\epsilon>0$, but $0$ seems to be a strange point, what can we do to analysis such point?
Moreove: for general $f(x)$ decreasing from 1 to 0, i.e, $f(0)=1,f(\infty)=0$, what is the maxium of $\liminf_{x\rightarrow 0^+}g(x)$?
The answer depends on the regularity of $f$. Let me first provide an example demonstrating that jump discontinuities makes the behavior of $g$ wild near $x = 0$.
On the other hand, almost-differentiability tames the behavior of $g$ near $x = 0$.
More generally, assume that $f$ is left-continuous so that we can write $f(x) = \mu([x, \infty))$ for some Borel probability measure supported on $[0, \infty)$. Then by the same argument as above, we easily check that
$$ g(x) = \int \left( \sum_{n=0}^{\infty} \mathbf{1}_{[2nx, (2n+1)x)}(t) \right) \, \mu(dt). $$
This formulation encompasses both Example 1 and 2. So the behavior of $g$ is intimately related to how much $\mu$ is sensitive to a 'small' change of integrand. But I have no good answer for general $\mu$.
Addendum 1. Interestingly enough, the averaged limit $ \ell := \lim_{\epsilon\downarrow 0} \frac{1}{\epsilon} \int_{0}^{\epsilon} g(x) \, dx $ can be explicitly characterized in terms of the behavior of $f$. (Here, we still assume that $f$ is left-continuous.) Indeed, let $\varphi : (0, \infty) \to \mathbb{R}$ by
\begin{align*} \varphi(t) &= \int_{0}^{1} \left( \sum_{n=0}^{\infty} \mathbf{1}_{\{ 2nx \leq t \leq (2n+1)x \}} \right) \, dx \\ &= 1 - \sum_{n=0}^{\infty} \left( \min\left\{ 1, \frac{t}{2n+1} \right\} - \min\left\{ 1, \frac{t}{2n+2} \right\} \right). \end{align*}
Then $\varphi(x)$ is continuous, bounded and converges to $\frac{1}{2}$ as $x\to\infty$. Now this function is related to $\ell$ by the following formula
$$ \frac{1}{\epsilon} \int_{0}^{\epsilon} g(x) \, dx = \int \varphi\left(\frac{t}{\epsilon}\right) \, \mu(dt). $$
So by taking $\epsilon \downarrow 0$, by the dominated convergence theorem
$$ \ell = \int \lim_{\epsilon\downarrow 0} \varphi\left(\frac{t}{\epsilon}\right) \, \mu(dt) = \int \frac{1}{2}( 1 + \mathbf{1}_{\{t = 0\}} ) \, \mu(dt) = \frac{1}{2}(1 + \mu(\{0\}) ). $$
Now notice that $\mu(\{0\}) = 1 - \lim_{\epsilon\downarrow 0} f(x)$ is the jump size at $x = 0$. So it follows that
$$ \lim_{\epsilon\downarrow 0} \frac{1}{\epsilon} \int_{0}^{\epsilon} g(x) \, dx = 1 - \frac{1}{2}\lim_{\epsilon\downarrow 0} f(\epsilon). $$
Addendum 2. As for the old question, we can also give an elementary solution. Indeed, we find that
\begin{align*} g(x) = \sum_{n=0}^{\infty} \frac{(-1)^n}{nx+1} &= \sum_{n=0}^{\infty} \left( \frac{1}{2nx+1} - \frac{1}{(2n+1)x+1} \right) \\ &= \sum_{n=0}^{\infty} \frac{x}{(2nx+1)((2n+1)x+1)}. \end{align*}
The trick is to identify the last sum as a certain Riemann sum. This provides us a way of comparing the sum with the corresponding integral. Indeed, when $x < \frac{1}{2}$ and $n \geq 0$, we have
$$ \int_{2(n+1)x}^{2(n+2)x} \frac{dt}{2(t+1)^2} \leq \frac{x}{(2nx+1)((2n+1)x+1)} \leq \int_{2(n-1)x}^{2nx} \frac{dt}{2(t+1)^2} $$
and hence
$$ \int_{2x}^{\infty} \frac{dt}{2(t+1)^2} \leq g(x) \leq \int_{-2x}^{\infty} \frac{dt}{2(t+1)^2}. $$
Taking $x \downarrow 1$ shows that $g(x) \to \int_{0}^{\infty} \frac{dt}{2(t+1)^2} = \frac{1}{2}$.