$(a_1,\cdots a_n)\rightarrow (|a_1-a|,\cdots ,|a_n-a|)\rightarrow\cdots\rightarrow (0,\cdots ,0)$ NOTE: I only need verification of part (b) of this question. But feel free to comment on anything about this question.

Given an initial sequence $a_1,\cdots a_n$ of real numbers, we perform a series of steps. At each step, we replace the current sequence $x_1,\cdots x_n$ with $|x_1-a|,\cdots |x_n-a|$ for some $a$. At each step, the value of $a$ can be different.
(a)Prove that it is always possible to obtain the null sequence consisting entirely of $0$'s.
(b)Determine with proof the minimum number of steps required, regardless of the initial sequence, to obtain the null sequence.
-Problem-17, Advanced Problems Section,$102$ Combinatorial Problems, Titu Andreescu, Zuming Feng 

To answer (a), apply the following algorithm:
1) $1$st step: $A_1=\dfrac{a_1+a_2}{2}$ where $A_i$ denotes the value of $a$ in the $i$th step
2)$2$nd step:$A_2=\dfrac{|a_2-\dfrac{a_1+a_2}{2}|+a_3}{2}$
n)$n$th step:$A_i=\dfrac{|a_i-A_{i-1}|+a_{i+1}}{2}$
After the $k$th step, the number of reals that are mutually equal in the sequence is at least $k+1$. So after the $n-1$th step, all of them will be equal to some value $p$. In the final step, just let $A_n=p$ and all of them turn into $0$.
If my above description was unclear, which I am sure it was, I would just tell you to consider the average of two numbers and experiment with it.
Now onto part(b). Here's where I am having a problem.
I claim that the answer to (b) is $n$.
Claim:If the original numbers are all pairwise distinct, then we always need $n$ steps.
Proof:
We induct on $n$.
For $n=1,2$, it is easy to prove.
Suppose it is true for all $n\le k$
For $n=k+1$,
After step-i, there are at least $k-i-1$ distinct numbers in the sequence for $i\le k-1$.
So after step-$(k-1)$, there are at least $k-k+1-1=2$ distinct numbers. These $2$ will require at least $2$ more moves and therefore in total $k-2+2=k+1$ moves, completing the induction.
However, the book gives a much more complicated solution for part (b), which makes me sure that my solution has a big loophole somewhere.
Where is the loophole in my solution of part (b)?

Your claim :"If the original numbers are all pairwise distinct, then we always need n steps." is not correct, in fact take for example the following  sequence:
$$(2,14,4,12,6,10)\xrightarrow{a=8}(6,6,4,4,2,2)\xrightarrow{a=5} (1,1,1,1,3,3)\xrightarrow{a=2} (1,1,1,1,1,1)\xrightarrow{a=1} (0,0,0,0,0,0)$$
which requires only $5$ steps, this can be preformed to obtain some sequences of length $n$ with different entries and requiring only $\log_2(n)$ steps.
Your proof is not very clear, but the faille is that after $k-1$ steps you will obtain the element of the first sequence are all equal but no one grantees that the rest will remain distinct so that you can apply the induction hypothesis again.
The idea of the prove $b$ you have to find a sequence which requires $n$ steps (if the answer is correct but I think that you have it in the book), you have to be sure in your choose sequence that the differences are large enough so that there is no  intersection problem like in the exemple above.
I hope that this answers your question (I don't know really which sequence will work)
