We need two properties of absolute value in order to prove $f$ is associative.
- Property 1: $|a\cdot b|=|a|\cdot|b|$
- Property 2: $\Big| |a| \Big|=|a|$
Here we go...
If $f$ is associative, then the following must be true.
$$\Big||a\cdot b|\cdot c\Big|=\Big|a\cdot|b\cdot c|\Big|$$
By property 1, we have
$$\Big| |a|\cdot|b|\cdot c\Big|=\Big|a\cdot |b|\cdot|c|\Big|$$
By property 1 again, we have
$$||a||\cdot||b||\cdot |c|=|a|\cdot||b||\cdot||c||$$
By property 2, we get
$$|a|\cdot|b|\cdot|c|=|a|\cdot|b|\cdot|c|$$
Done!
Update
Based on the comment of @pjs36, I better formalize the proof.
If $f$ is associative, then the following must be true.
$$\Big||a\cdot b|\cdot c\Big|=\Big|a\cdot|b\cdot c|\Big|$$
We work with the left-hand side, $\Big||a\cdot b|\cdot c\Big|$, and work to make this the right-hand side.
\begin{align}
\Big||a\cdot b|\cdot c\Big|&=\Big| |a|\cdot|b|\cdot c\Big|&\text{Prop 1 on $|a\cdot b|$}\\
&=\Big||a|\Big|\cdot\Big||b|\Big|\cdot |c|&\text{Prop 1}\\
&=|a|\cdot\Big||b|\Big|\cdot\Big||c|\Big|&\text{Prop 2}\\
&=\Big|a\cdot|b|\cdot|c|\Big|&\text{Prop 1}\\
&=\Big|a\cdot|b\cdot c|\Big|&\text{Prop 1}
\end{align}
Therefore, $f$ is associative.