Equation $x^2=[0]_n$ in $\mathbb{Z}_n$ 
Let $n=p_1^{n_1}........p_s^{n_s}$ where $p_i$ are discrete prime
numbers and $n_i >0$ for all $i=1,2, \cdots ,s$. Find all  $x \in
 \mathbb{Z}_n$ such that $x^2=[0]$.

I have done the half way. But i have stuck in the end, something i don't understand.
Let $x=[a] \in \mathbb{Z}_n$ . Hence $x^2=[a^2]$.
$[a^2]=[0] \Leftrightarrow a^2 \equiv 0 \, \pmod n \Leftrightarrow n|a^2 \Leftrightarrow p_1^{n_1}........p_s^{n_s}|a^2 $
Also the $mcd (p_1^{n_1},..,p_s^{n_s})=1$ and so
$\left\{\begin{matrix}
p_1^{n_1}|a^2\\ 
\vdots\\ 
p_s^{n_s}|a^2
\end{matrix}\right. \Rightarrow \left\{\begin{matrix}
p_1^{n_1}|p_1^{2a_1}........p_s^{2a_s}\\ 
\vdots\\ 
p_s^{n_s}|p_1^{2a_1}........p_s^{2a_s}
\end{matrix}\right.$
We can notice that $\forall i \,\,\, n_i \leq 2a_i$
Now something i don't understand here to continue.
We need to keep those factors $p_i^{k_i}$  such that
$\left\{\begin{matrix}
p_1^{k_1}|a\\ 
\vdots\\ 
p_s^{k_s}|a
\end{matrix}\right.\Rightarrow p_1^{k_1} \cdots p_s^{k_s}|a $
and $x=[ p_1^{k_1} \cdots p_s^{k_s}],[2 p_1^{k_1} \cdots p_s^{k_s}], \cdots , [k p_1^{k_1} \cdots p_s^{k_s}]$ for some $k \in \mathbb{Z}$ such that $k p_1^{k_1} \cdots p_s^{k_s} < n$
 A: What you've done so far is basically correct. One thing which is missing is the definition for $k_i$. You have
$$n_i \leq 2a_i \implies \frac{n_i}{2} \leq a_i \tag{1}\label{eq1A}$$
Since $a_i$ are integers, \eqref{eq1A} is equivalent to $a_i$ being at least the next larger integer on the LHS if it's not an integer already, i.e., you equivalently have
$$\left\lceil\frac{n_i}{2}\right\rceil \leq a_i \tag{2}\label{eq2A}$$
Since the $k_i$ are the smallest possible values of $a_i$, they are
$$k_i = \left\lceil\frac{n_i}{2}\right\rceil \tag{3}\label{eq3A}$$
To help keep the algebra simpler, let
$$q = p_1^{k_1}\cdots p_s^{k_s} = \prod_{i=1}^{s}p_i^{k_i} \tag{4}\label{eq4A}$$
Note all integral multiples of $q$ also satisfy $x^2 \equiv 0 \pmod{n}$. In addition, since $n_i \ge \left\lceil\frac{n_i}{2}\right\rceil \; \forall \; 1 \le i \le s$, you have $q \mid n$. Thus, the list of values for $x$ would be, starting at $q$,
$$x = [q], [2q], \; \ldots \; , [kq] \tag{5}\label{eq5A}$$
where
$$k = \frac{n}{q} \tag{6}\label{eq6A}$$
You made a small mistake in having $k p_1^{k_1} \cdots p_s^{k_s} \lt n$ where $\lt$ should be $\le$ instead, plus $k$ should be the largest value, not just some value.
Since $[kq] = [n] = [0]$, you could alternatively list the solutions as
$$x = [0], [q], \; \ldots \; , [(k - 1)q] \tag{7}\label{eq7A}$$
