  We study the cosmological inflation and dark matter (DM) in a unified way
within a $Z_3$ complex scalar model. The real and imaginary parts of the
complex scalar act as the inflaton and DM respectively. The slow-rolling
inflation with non-minimal coupling in both the metric and Palatini formalisms
can be realized. We examine the whole parameters space by fully considering the
theoretical and experimental constraints. We find that in the low-energy scale,
the DM relic density and the DM-nucleon direct scattering experiments favor the
mixing angle $|\theta| \lesssim 0.25$, the DM mass $m_\chi \gtrsim 80\rm{GeV}$,
and the mass of Higgs-like scalar $m_{h_2} \gtrsim 300\rm{GeV}$. In the
high-energy scale, after further considering the cosmological constraints of
the scalar spectral index and the tensor-to-scalar ratio for the two forms of
inflation, the scalar spectral indices are both $\sim 0.965$, the non-minimum
coupling coefficients are $\sim 10^4$ and $\sim 10^9$, and the tensor-to-scalar
ratios are $\sim 10^{-3}$ and $\lesssim 10^{-11}$ respectively, which suggests
that the inflation under the two formalisms can be distinguished by measuring
the tensor-to-scalar ratio with higher precision.
