Product Category is Category

Theorem
Let $\mathcal C$ and $\mathcal D$ be categories.

Then the product category $\mathcal C \times \mathcal D$ is a category.

Proof
Let $(X,Y),(X',Y') \in \mathcal C \times \mathcal D$.

Let $(f,g) : (X,Y) \to (X',Y')$ and $(h,k) : (X',Y') \to (X,Y)$ be morphisms.

Let $\operatorname{id}_X$, $\operatorname{id}_Y$ be the identity morphisms for the objects $X$ and $Y$ respectively.

Then:

Similarly,

Therefore $(\operatorname{id}_X,\operatorname{id}_Y)$ satisfies the property of an identity morphism.

Now let $(f,g)$, $(h,k)$ and $(\ell,m)$ be morphisms of $\mathcal C \times \mathcal D$. We have:

Therefore composition of morphisms in $\mathcal C \times \mathcal D$ is also associative.