Prove that $\left(\overrightarrow{a} \times \overrightarrow{b}\right) \times \overrightarrow{c} = \overrightarrow{a} \times \left(\overrightarrow{b} \times \overrightarrow{c}\right)$ iff $\overrightarrow{a}$ and $\overrightarrow{c}$ are collinear.
If $\;$ $\left(\overrightarrow{a} \times \overrightarrow{b}\right) \times \overrightarrow{c} = \overrightarrow{a} \times \left(\overrightarrow{b} \times \overrightarrow{c}\right)$ $\;$ then
$\left(\overrightarrow{a} \cdot \overrightarrow{c}\right) \overrightarrow{b} - \left(\overrightarrow{b} \cdot \overrightarrow{c}\right) \overrightarrow{a} = \left(\overrightarrow{a} \cdot \overrightarrow{c}\right) \overrightarrow{b} - \left(\overrightarrow{a} \cdot \overrightarrow{b}\right) \overrightarrow{c}$
i.e. $\;$ $\left(\overrightarrow{b} \cdot \overrightarrow{c}\right) \overrightarrow{a} = \left(\overrightarrow{a} \cdot \overrightarrow{b}\right) \overrightarrow{c}$
Let $\left(\overrightarrow{b} \cdot \overrightarrow{c}\right) = p$; $\;$ $\left(\overrightarrow{a} \cdot \overrightarrow{b}\right) = q$ $\;$ where $p$ and $q$ are scalar quantities.
$\therefore$ $\;$ We have $\;$ $p \overrightarrow{a} = q \overrightarrow{c}$
$\implies$ $\overrightarrow{a} = \left(\dfrac{p}{q}\right) \overrightarrow{c}$
$\implies$ $\overrightarrow{a}$ and $\overrightarrow{c}$ are collinear vectors. $\;\;\; \cdots \; (1)$
[Note: Two vectors are collinear if one vector is a scalar multiple of the other.]
Let $\overrightarrow{a}$, $\overrightarrow{b}$ and $\overrightarrow{c}$ be three vectors.
Given: $\;$ $\overrightarrow{a}$ and $\overrightarrow{c}$ are collinear vectors, then
$\overrightarrow{a} = k \overrightarrow{c}$ $\;$ where $k$ is a scalar quantity.
Then,
$\begin{aligned}
\left(\overrightarrow{a} \times \overrightarrow{b}\right) \times \overrightarrow{c} & = \left(k \overrightarrow{c} \times \overrightarrow{b}\right) \times \overrightarrow{c} \\\\
& = \left(k \overrightarrow{c} \cdot \overrightarrow{c}\right) \overrightarrow{b} - \left(\overrightarrow{b} \cdot \overrightarrow{c}\right) k \overrightarrow{c} \;\;\; \cdots \; (2a)
\end{aligned}$
$\begin{aligned}
\overrightarrow{a} \times \left(\overrightarrow{b} \times \overrightarrow{c}\right) & = k \overrightarrow{c} \times \left(\overrightarrow{b} \times \overrightarrow{c}\right) \\\\
& = \left(k \overrightarrow{c} \cdot \overrightarrow{c}\right) \overrightarrow{b} - \left(k \overrightarrow{c} \cdot \overrightarrow{b}\right) \overrightarrow{c} \\\\
& = \left(k \overrightarrow{c} \cdot \overrightarrow{c}\right) \overrightarrow{b} - \left(\overrightarrow{c} \cdot \overrightarrow{b}\right) k \overrightarrow{c} \;\;\; \cdots \; (2b)
\end{aligned}$
$\therefore$ $\;$ From equations $(2a)$ and $(2b)$ we have
$\left(\overrightarrow{a} \times \overrightarrow{b}\right) \times \overrightarrow{c} = \overrightarrow{a} \times \left(\overrightarrow{b} \times \overrightarrow{c}\right)$ $\;\;\; \cdots \; (2)$
$\therefore$ $\;$ We have from equations $(1)$ and $(2)$
$\left(\overrightarrow{a} \times \overrightarrow{b}\right) \times \overrightarrow{c} = \overrightarrow{a} \times \left(\overrightarrow{b} \times \overrightarrow{c}\right)$ iff $\overrightarrow{a}$ and $\overrightarrow{c}$ are collinear.