As I tried to say, it's much simpler to use the local form of electrostatic laws and a symmetry argument on the electrostatic potential.
The equations read
$$\vec{\nabla} \times \vec{E}=0, \quad \vec{\nabla} \cdot \vec{E}=\frac{1}{\epsilon_0} \rho.$$
From the first equation it's clear that (at least locally)
$$\vec{E}=-\vec{\nabla} \Phi,$$
and the 2nd equation implies that
$$\Delta \Phi=-\frac{1}{\epsilon_0} \rho.$$
By symmetry, i.e., because ##\rho## depends only on ##z##, it's clear that an ansatz with ##\Phi=\Phi(z)## should be a good idea.
This simplifies the Poisson equation to
$$\Phi''(z)=-\frac{1}{\epsilon_0} \rho(z).$$
Now
$$\rho(z)=\begin{cases} \alpha z^2 &\text{for} \quad z \in (-a,a),\\ 0 & \text{for} z \notin (-a,a). \end{cases}$$
where ##a=5 \; \text{cm}## and ##\alpha=5 \cdot 10^{-3} \text{C}{\text{m}^5}## (though I don't care about these values, which you can plug in at the very end of the calculation).
So for ##-a<z<a## we have
$$\Phi''(z)=-\frac{\alpha}{\epsilon_0} z^2 \; \Rightarrow \; \Phi(z)=-\frac{\alpha}{12 \epsilon_0} z^4 + C_1 + C_2 z.$$
For ##z>a##
$$\Phi''(z)=0\; \Rightarrow \; \Phi(z)=C_1'+C_2' z.$$
Because ##\rho(z)=\rho(-z)## we can also assume that ##\Phi(z)=\Phi(-z)##. This leads to ##C_2=0##. Further ##\Phi## is determined only up to an additive constant. So we can also set ##C_1=0##.
Since there are no surface-charge densities, ##\Phi## as well as ##\Phi'## must be continuous, which means that
$$\Phi(a-0^+)=-\frac{\alpha}{12 \epsilon_0} a^4=\Phi(a+0^+)=C_1' + C_2' a \qquad (1)$$
and
$$\Phi'(a-0^+)=-\frac{\alpha}{3 \epsilon_0} a^3 = \Phi'(a+0^+)=C_2'. \qquad (2)$$
Plugging this into (1) leads to
$$C_1'-\frac{\alpha}{3 \epsilon_0} a^4=-\frac{\alpha}{12 \epsilon_0}a^4 \; \Rightarrow \; C_1'=\frac{\alpha}{4 \epsilon_0}a^4.$$
For ##z<a## we can continue the solution for ##z>a## as an even function:
$$\Phi(z)=C_1'-C_2' z=C_1' + C_2'|z|.$$
So finally we have
$$\Phi(z) = \begin{cases}
-\frac{1}{12 \epsilon_0} z^4 &\text{for} \quad |z|<a, \\
-\frac{\alpha}{3 \epsilon_0} a^3 |z| + \frac{\alpha}{4 \epsilon_0}a^4 &\text{for} \quad |z| \geq a
\end{cases}$$
and
$$\vec{E}=-\vec{\nabla} \Phi = \begin{cases}\frac{1}{3 \epsilon_0} z^3 \vec{e}_z&\text{for} \quad |z|<a, \\
\frac{\alpha}{3 \epsilon_0} a^3 \text{sign} z \vec{e}_z &\text{for} \quad |z| \geq a.\end{cases}$$