[proofplan]
The proof is a direct unpacking of the definition of a covariant functor. Necessity follows because any functor is required to preserve identity morphisms and composition. Conversely, if the proposed object and morphism assignments have the stated domains and codomains and satisfy exactly those two equations, then all functor axioms are satisfied, so the assignments define a functor.
[/proofplan]
[step:Derive the two equations from the functor axioms]
Assume first that the assignments define a covariant functor $F:\mathcal{C}\to\mathcal{D}$. By the identity axiom for a functor, for every object $X \in \operatorname{Ob}(\mathcal{C})$ one has
\begin{align*}
F(\operatorname{id}_X)=\operatorname{id}_{F(X)}.
\end{align*}
By the composition axiom for a functor, for every composable pair of morphisms $f:X\to Y$ and $g:Y\to Z$ in $\mathcal{C}$ one has
\begin{align*}
F(g\circ f)=F(g)\circ F(f).
\end{align*}
Thus the two stated conditions are necessary.
[/step]
[step:Use the two equations to verify the functor axioms]
Conversely, assume that the object assignment $F_0$ and the morphism assignments $F_{X,Y}$ have the stated domains and codomains, and assume that the two displayed equations hold.
Define $F$ on objects by
\begin{align*}
F(X) := F_0(X)
\end{align*}
for each $X \in \operatorname{Ob}(\mathcal{C})$, and define $F$ on morphisms by
\begin{align*}
F(f) := F_{X,Y}(f)
\end{align*}
for each morphism $f \in \operatorname{Hom}_{\mathcal{C}}(X,Y)$. The codomain condition on $F_{X,Y}$ gives
\begin{align*}
F(f) \in \operatorname{Hom}_{\mathcal{D}}(F(X),F(Y)),
\end{align*}
so $F$ sends each morphism $f:X\to Y$ in $\mathcal{C}$ to a morphism $F(f):F(X)\to F(Y)$ in $\mathcal{D}$.
The first assumed equation says exactly that $F$ preserves identity morphisms. The second assumed equation says exactly that $F$ preserves composition of composable morphisms. Therefore the object and morphism assignments satisfy all axioms in the definition of a covariant functor, and hence define a functor $F:\mathcal{C}\to\mathcal{D}$.
[/step]
[step:Conclude the equivalence]
The first step proves necessity, and the second step proves sufficiency. Therefore the proposed assignments define a covariant functor precisely when they preserve identity morphisms and composition.
[/step]