Define
$$f(x) = \begin{cases} x^2\cos(1/x^2) & \text{ if } x\neq 0, x \in [-1,1] \\ 0& \text{ if } x= 0. \end{cases}$$
and $$g(x) = \begin{cases} x^2\cos(1/x) & \text{ if } x\neq 0, x \in [-1,1] \\ 0& \text{ if } x= 0. \end{cases}$$ are $f$ and $g$ of bounded variation?
Proof:
First, we have that $$TV(f) = TV(f_{[-1,0]}) + TV(f_{[0,1]}) \geq TV(f_{[0,1]}).$$ We claim that $f$ is not of bounded variation, for instance, consider the partition, $$P_{2n} = \{ 0 < x_n < x_{n-1} < \cdots < x_1 < 1\},$$ where $x_n := 1/\sqrt{n\pi}$. Note that $$f(x) = \begin{cases} \frac{1}{n\pi} & \text{ if $n$ is even} \\ -\frac{1}{n\pi} & \text{ if $n$ is odd }. \end{cases}$$ Therefore $$|f(x_{2n}) - f(x_{2n+1}| = |f(x_{2n+1}) - f(x_{2n}| = \frac{1}{2n\pi} + \frac{1}{2(n+1)\pi},$$ but $$ TV(f) \geq TV(f_{[0,1]}) \geq \sum_{k=1}^{\infty}|f(x_{2k}) - f(x_{2k+1}| = \cdots\\ \cdots= \frac{1}{2\pi}\sum_{k=1}^{\infty}(\frac{1}{n} + \frac{1}{n+1}) \geq\frac{1}{2\pi} \sum_{k=1}^{\infty}\frac{1}{n} = \infty,\\ $$ therefore $f$ is not of bounded variation. On the other hand, we claim that $g$ is of bounded variation, to see this we only need to prove that is Lipchitz. By usual differentiation, we have $$g'(x) = 2x\cos(1/x) - \sin(1/x),$$ and $$g'(0) = \lim_{h \to 0} \frac{g(h) - g(0)}{h} = \lim_{h \to 0} h\cos(1/h) = \cdots \\ \cdots = \lim_{h \to 0} \frac{\cos(1/h)}{\frac{1}{h}} = \lim_{h \to \infty} \frac{\cos(h)}{h} = 0,$$ thus, the derivative exists for each $x \in [-1,1]$. Moreover, $g \to 0$ as $x \to \infty$. To see this notice that $$\lim_{x \to 0} g(x) = \lim_{x \to 0}x^2\cos(1/x) = \lim_{x \to \infty} \frac{\cos(x)}{x^2},$$ so that $g$ is continuous. Now, $$|g'(x)| \leq |2x\cos(1/x)| + |\sin(1/x)| \leq |2x| + 1 \leq 3.$$ To prove that $g$ is Lipschitz, let $x < y$ in $[-1,1]$, then by the mean value theorem, there exists $\xi \in (x,y)$ such that $$|g(x) - g(y)| = |g(\xi)||x-y|,$$ but $|g'(x)| \leq 3$, therefore $$|g(x) - g(y)| = 3|x-y|,$$ for each $x$ and $y$ in $[-1,1]$. Thus $g$ is $3-$Lipschitz and therefore of bounded variation.
Is this solution correct. I receive a hint that $g$ is differentiable as the standard way, can someone provide a proof on why it is so.