sum of alternating $|f|$ and $|f|^2$

Does anyone know an example of a function $$f$$ for which the relation $$\sum_{n=1}^\infty (-1)^n |f(n)| < \infty \\ \Longleftrightarrow \\ \sum_{n=1}^\infty (-1)^n |f(n)|^2 < \infty$$ is violated?

Even though the counterexamples are somewhat valid I was more thinking about a differentiable function $$f(n)$$, possibly even analytic.

In a similar manner: Does the following hold $$\sum_{n=1}^\infty (-1)^n |f(n)|^2 < \infty \\ \Longrightarrow \quad \sum_{n=1}^\infty \frac{(-1)^n|f(n)|^2}{1+a^2 |f(n)|^2} < \infty$$ where $$a>0$$ ? The last one is interesting, because for $$a=0$$ this matches the assumption and for $$a \rightarrow \infty$$ the sum is bounded as well since $$\left|\sum_{n=1}^\infty (-1)^n\right| \leq 1$$.

If it is even possible to show $$\sum_{n=1}^\infty \frac{(-1)^n|f(n)|^2}{1+a^2 |f(n)|^2} \sim {\cal O}\left(a^{-1-\epsilon}\right) \qquad {\rm as} \qquad a\rightarrow \infty$$ and $$\epsilon>0$$ then the integral $$\frac{1}{\pi} \int_{-\infty}^{\infty} \sum_{n=1}^\infty \frac{(-1)^n|f(n)|^2}{1+a^2 |f(n)|^2} \, {\rm d}a = \sum_{n=1}^\infty (-1)^n |f(n)| < \infty$$ is well defined and reproduces the first relation.

• I think you mean an example for which the relation is violated. a counterexample to violating the biconditional would be an example showing it – mathworker21 Dec 1 '18 at 12:09
• True, I was thinking about a counterexample and ended the sentence wrong. – Diger Dec 1 '18 at 12:11
• See also math.stackexchange.com/questions/2570953/… The counterexample by I.Browne can be adapted to your case by reindexing with $f(n)=0$ for unwanted terms. This time the first series is convergent while the second is not. In the other answers you get here, it is the opposite. – zwim Dec 1 '18 at 13:26
• Good example for the other way around, but unfortunately still not analytic. – Diger Dec 1 '18 at 13:34

You can put all the weight of the harmonic series on the terms with one sign. For instance $$f (n)=\begin {cases}1/n,&n\ \text {odd},\\ \ \ 0,&n\ \text {even}\end {cases}$$ makes the first series divergent and the second convergent.