I was traying to define the cofinality $\mbox{cf}$ as a function from the class of all sets to the class of all cardinals, as Kelley does with the function $\mbox{card}$.
Clearly the assignment $A\mapsto \mbox{cf }A$ is well defined, taking for example the definition
$$ \mbox{cf A} = \inf \{\kappa : B\mbox{ is cofinal on } A \mbox{ and } \kappa=\mbox{card }B\} .$$
Now, with AC, is clear that $\mbox{dom }\mbox{cf} =\mathcal U $, the class of all sets, since every sets admits a well-order and then we can talk about cofinal subsets on them.
It is also clear $\mbox{im }\mbox{cf}$ is a subset or subclass of the class of all cardinals. But are they the same?. Since all cardinals $\aleph_\alpha$ are regulars up to $\omega$, both must agree up to $\omega$. For $\aleph_\omega$, I know its cofinality is $\omega$. However, that doesn't proof there is no a set $A$ such that $\mbox{cf }A = \aleph_\omega$.
Thanks in advance.
You can prove for any ordinal that $cf(cf(\alpha))=cf (\alpha)$: any cofinal sequence in $cf(\alpha)$ gives rise to a cofinal sequence in $\alpha$ by composing with the cofinal embedding $cf(\alpha) \rightarrow \alpha$.
Thus if $cf(\alpha) < \alpha$, there can be no way to make $\alpha$ the cofinality of any ordinal.
As an aside, I'm not entirely comfortable with your definition of cofinality on a set without specifying a well-ordering. Under AC every non-empty set has a well-ordering with a maximum element, so if your infinum is taken over all well-orderings on $A$ then it is $1$ for all sets.