I have the following definition of finite category:
Let $\mathcal{C}$ be a category. We say that $\mathcal{C}$ is finite if $\bigcup_{x,y\in\text{Ob}(\mathcal{C})}\text{Hom}_{\mathcal{C}}(x,y)$ is finite. (So in particular, $\text{Ob}(\mathcal{C})$ is finite).
I don't understand why $\bigcup_{x,y\in\text{Ob}(\mathcal{C})}\text{Hom}_{\mathcal{C}}(x,y)$ being finite implies that $\text{Ob}(\mathcal{C})$ is finite.
For each $x\in\mathcal{C}$, we know that $\{1_x\}\subset\text{Hom}_{\mathcal{C}}(x,x)$. This implies that $$\bigcup_{x\in\text{Ob}(\mathcal{C})}\{1_x\}\subset\bigcup_{x,y\in\text{Ob}(\mathcal{C})}\text{Hom}_{\mathcal{C}}(x,y)$$ and so $\bigcup_{x\in\text{Ob}(\mathcal{C})}\{1_x\}$ is finite.
Now define a mapping $f:\text{Ob}(\mathcal{C})\rightarrow\bigcup_{x\in\text{Ob}(\mathcal{C})}\{1_x\}$ by writing $f(x):=1_x$ for all $x\in\text{Ob}(\mathcal{C})$. We're done if we can show that $f$ is an injection. But $f$ is not an injection: take $x,y\in\text{Ob}(\mathcal{C})$ such that $f(x)=f(y)$; this means that $1_x=1_y$ and how can we conclude that this implies $x=y$? I can't see how.
For example, if this latter equality were in Set, then the equality of $1_x=1_y$ would imply that $x=y$ from the definition of mapping (i.e. equal maps must have equal domains). I'm not even sure what the equality $1_x=1_y$ means in an arbitrary category...
Anyways, how can one show that $\text{Ob}(\mathcal{C})$ is finite?