Examples and counterexamples: functions whose powers are of bounded variation Let $f:\mathbb{R}\to \mathbb{R}$. We know that, if $f \in BV(\mathbb{R})$, then, $\forall p \in \mathbb{N}$, $f^p \in BV(\mathbb{R})$. 
Now 


*

*can you give an example of a function $g:\mathbb{R}\to \mathbb{R}$ such that $g \notin BV(\mathbb{R})$ and $g^2 \in BV(\mathbb{R})$?

*can you give an example of a function $h:\mathbb{R}\to \mathbb{R}$ such that $h \notin BV(\mathbb{R})$ and $h^3 \in BV(\mathbb{R})$?
Also, 


*

*is there a function $w:\mathbb{R}\to \mathbb{R}$ such that $w \notin BV(\mathbb{R})$ and $w^p \in BV(\mathbb{R})$ $\forall p \in \mathbb{N}$?

 A: Let $n\in \mathbb{N}$, define $f: [0,\infty) \rightarrow \mathbb{R}$ by 
$$f(x) = (-1)^n \frac{1}{n} \quad \text{ if } x\in [n,n+1).$$
$f\not \in BV(\mathbb{R})$, since we see that the variation of $f$ at each natural number $n$ is $\frac{1}{n} + \frac{1}{n+1}$ which is greater than $\frac{2}{n+1}$, and the sum $\sum\frac{2}{n+1}$ goes to infinity. 
However $f^p\in BV$ for $p\geq 2$ based on the fact that $\sum\frac{1}{n^p}$ converges for $p\geq 2$ .
A: Define $w(n) = 1/(n\ln (n+1)), n \in \mathbb N,$ $w =0$ on $\mathbb R \setminus \mathbb N.$ Then $w\notin BV(\mathbb R),$ but $w^p \in BV(\mathbb R)$ for all $p\in (1,\infty).$ This example works for all three parts.
A: A nice example is the function
$$
f(x)=\left\{\begin{array}{cll}
x\sin(1/x) & \text{if} & x\ne 0, \\
0 & \text{if} & x=0.
\end{array}\right.
$$
Clearly, $f$ is continuous, $V_a^b(\,f)=\infty$, whenever $0\in(a,b)$, and
$V_a^b(\,f^k)<\infty$, for every $k>1$ and  $a,b\in \mathbb R$.
For $k=1$: 
$$
V_0^1(\,f)\ge \sum_{n=1}^\infty \left|\,f\left(\frac{1}{n\pi+\pi/2}\right)-f\left(\frac{1}{(n-1)\pi+\pi/2}\right)\right|=
\sum_{n=1}^\infty \left|\,\frac{1}{n\pi+\pi/2}+\frac{1}{(n-1)\pi+\pi/2}\right|=\infty
$$
For $k>1$,
$$
V_0^1(\,f^k)=\int_0^1 \left|\big(\,f^k(t)\big)'\right|\,dt
= k\int_0^1 \lvert\,f^{k-1}(t)\rvert\cdot\lvert\sin(1/x)-\cos(1/x)/x\rvert\,dt
\le k\int_0^1 x^{k-1}\Big(1+\frac{1}{x}\Big)\,dx=1+\frac{1}{k-1}.
$$
