It is well known that proving the existence of measurable sets or functions requires the axiom of choice, which means that it is consistent with ZF that all functions $\mathbb R \to \mathbb R$ are measurable. However, in this answer it is argued that there are only continuum many measurable functions, an apparent contradiction as the set of all functions $\mathbb R \to \mathbb R$ has a cardinality greater than the continuum.
Clearly there's some use of axiom of choice somewhere here that resolves the apparent contradiction, but I really don't see it. Where is AoC used and what's going on?