9. (16 points) In $\triangle A B C$, $B C=a, C A=b$, $A B=c$. If $b$ is the geometric mean of $a$ and $c$, and $\sin A$ is the arithmetic mean of $\sin (B-A)$ and $\sin C$, find the value of $\cos B$.

---

The translation retains the original text's formatting and structure.
9. Since $b$ is the geometric mean of $a$ and $c$, there exists $q>0$ such that:
$$
b=q a, c=q^{2} a \text {. }
$$

Also, $\sin A$ is the arithmetic mean of $\sin (B-A)$ and $\sin C$, thus
$$
\begin{array}{l}
2 \sin A=\sin (B-A)+\sin C \\
=\sin (B-A)+\sin (B+A) \\
=2 \sin B \cdot \cos A .
\end{array}
$$

Combining the Law of Sines and the Law of Cosines, we get
$$
\begin{array}{l}
\frac{a}{b}=\frac{\sin A}{\sin B}=\cos A=\frac{b^{2}+c^{2}-a^{2}}{2 b c} \\
\Rightarrow b^{2}+c^{2}-a^{2}=2 a c .
\end{array}
$$

Substituting equation (1) and simplifying, we get
$$
\begin{array}{l}
q^{2}+q^{4}-1=2 q^{2} \Rightarrow q^{4}=q^{2}+1 \\
\Rightarrow q^{2}=\frac{\sqrt{5}+1}{2} .
\end{array}
$$

Therefore, $\cos B=\frac{c^{2}+a^{2}-b^{2}}{2 a c}$
$$
=\frac{q^{4}+1-q^{2}}{2 q^{2}}=\frac{1}{q^{2}}=\frac{\sqrt{5}-1}{2} \text {. }
$$