Show that $ f \in BV[0, \pi] $ and find $ V_0^\pi f $ where $ f(x) = \cos^2(x) - 1, \;x \in [0,\pi] $ I'm learning about functions of bounded variation and need some help with this problem :

Show that the function $ f $ is of bounded variation on $ [0,\pi] $ and find it's total variation. $$ f(x) = \cos^2(x) - 1, \;x \in [0,\pi] $$

Here's my attempt : 
$ f'(x) = 2\cos(x) \frac{d}{dx} \cos(x) = 2\cos(x)(-\sin(x)) = -2\sin(x)\cos(x) = -\sin(2x) $ 
The function $ f $ is differentiable on $ [0,\pi] $ and $ \forall x \in [0, \pi] $ we have :
$$ \lvert f'(x) \rvert = \lvert -\sin(2x) \rvert \le 1 $$ 
Since the derivative of $ f $ is bounded on $ [0,\pi] $ this implies that $ f \in BV[0, \pi] $. 
To calculate the total variation of $ f $ we need to determine the critical points of $ f $ : 
$$ f'(x) = 0 \iff -\sin(2x) = 0 \Rightarrow x = 0 \; \text{or} \; x = \frac{\pi}{2} $$
but I don't know how to continue from here to find $ V_0^\pi f$ . 
 A: It is worth mentioning that there is a faster way to find the total variation of a Lipschitz function, indeed we have a formula for it in terms of the $L^1$ norm of the derivative:
$$V_0^{\pi}f = \int_0^{\pi}|f'(t)|\,dt = \int_0^{\pi}|\sin(2t)|\,dt = 2.$$
A: First, consider the following partition of $[0,\pi]$: $\{0,\pi/2,\pi\}$. By definition, 
\begin{equation}
V_0^{\pi}f\geq\vert f(\pi)-f(\pi/2)\vert + \vert f(\pi/2)-f(0)\vert=1+1=2
\end{equation}
Next, notice $f'(x)=-\sin(2x)$ is negative in $[0,\pi/2]$ and positive in $[\pi/2,\pi]$. So $f$ is decreasing in $[0,\pi/2]$ and increasing in $[\pi/2,\pi]$. Then, for any partition $\{a_0=0,a_1,...,a_n=\pi\}$ of $[0,\pi]$, if $a_{j+1}\leq \pi/2$, then 
\begin{equation}
\vert f(a_{j+1})-f(a_j)\vert = -(f(a_{j+1})-f(a_j)) = f(a_j)-f(a_{j+1})
\end{equation}
This implies the sum of the terms of the partition below $\pi/2$ (that is, where $f$ is decreasing) is given by
\begin{equation}
\sum_{j=1}^{k_1}\vert f(a_{j+1})-f(a_j)\vert = \sum_{j=1}^{k_1}(f(a_j)-f(a_{j+1})) = f(0)-f(a_{k_1+1})
\end{equation}
for $k_1$ such that $a_{k_1+1}\leq \pi/2\leq a_{k_1+2}$. Likewise, the sum of the terms of the partition above $\pi/2$ (where $f$ is increasing) is given by
\begin{equation}
\sum_{j=k_1+2}^{n}\vert f(a_{j+1})-f(a_j)\vert = \sum_{j=k_1+2}^{n}f(a_{j+1})-f(a_j) = f(\pi)-f(a_{k_1+2})
\end{equation}
Finally, 
\begin{eqnarray}
\vert f(a_{k_1+2})-f(a_{k_1+1})\vert & \leq & \vert f(a_{k_1+2})-f(\pi/2)\vert + \vert f(\pi/2)-f(a_{k_1+1})\vert\\
& = & f(a_{k_1+2}) - f(\pi/2) + f(a_{k_1+1}) - f(\pi/2)  
\end{eqnarray}
Then 
\begin{eqnarray}
\sum_{j=1}^{n}\vert f(a_{j+1})-f(a_j)\vert & = &\sum_{j=1}^{k_1}f(a_{j+1})-f(a_j)+\vert f(a_{k_1+2})-f(a_{k_1+1})\vert+\sum_{j=k_1+2}^{n}f(a_{j+1})-f(a_j)\\
& = & f(0)-f(a_{k_1+1})+\vert f(a_{k_1+2})-f(a_{k_1+1})\vert+f(\pi)-f(a_{k_1+2}) \\
& \leq & f(0)-f(\pi/2)+f(\pi)-f(\pi/2)\\
& = & 2 
\end{eqnarray}
This shows $V_0^{\pi}f\leq 2$. We conclude $V_0^{\pi}f=2$.
