Let $mathscr{C}$ be a category with an involution $ast$. Suppose that $varphi : X rightarrow X$ is a morphism and $(varphi_1, Z, varphi_2)$ is an (epic, monic) factorization of $varphi$ through $Z$, then $varphi$ is core invertible if and only if $(varphi^{ast})^2varphi_1$ and $varphi_2varphi_1$ are both left invertible if and only if $((varphi^{ast})^2varphi_1, Z, varphi_2)$, $(varphi_2^{ast}, Z, varphi_1^{ast}varphi^{ast}varphi)$ and $(varphi^{ast}varphi_2^{ast}, Z, varphi_1^{ast}varphi)$ are all essentially unique (epic, monic) factorizations of $(varphi^{ast})^2varphi$ through $Z$. We also give the corresponding result about dual core inverse. In addition, we give some characterizations about the coexistence of core inverse and dual core inverse of an $R$-morphism in the category of $R$-modules of a given ring $R$.