Let $mathscr{C}$ be an additive category with an involution $ast$. Suppose that $varphi : X rightarrow X$ is a morphism of $mathscr{C}$ with core inverse $varphi^{co} : X rightarrow X$ and $eta : X rightarrow X$ is a morphism of $mathscr{C}$ such that $1_X+varphi^{co}eta$ is invertible. Let $alpha=(1_X+varphi^{co}eta)^{-1},$ $beta=(1_X+etavarphi^{co})^{-1},$ $varepsilon=(1_X-varphivarphi^{co})etaalpha(1_X-varphi^{co}varphi),$ $gamma=alpha(1_X-varphi^{co}varphi)beta^{-1}varphivarphi^{co}beta,$ $sigma=alphavarphi^{co}varphialpha^{-1}(1_X-varphivarphi^{co})beta,$ $delta=beta^{ast}(varphi^{co})^{ast}eta^{ast}(1_X-varphivarphi^{co})beta.$ Then $f=varphi+eta-varepsilon$ has a core inverse if and only if $1_X-gamma$, $1_X-sigma$ and $1_X-delta$ are invertible. Moreover, the expression of the core inverse of $f$ is presented. Let $R$ be a unital $ast$-ring and $J(R)$ its Jacobson radical, if $ain R^{co}$ with core inverse $a^{co}$ and $jin J(R)$, then $a+jin R^{co}$ if and only if $(1-aa^{co})j(1+a^{co}j)^{-1}(1-a^{co}a)=0$. We also give the similar results for the dual core inverse.