If \(A\) and \(B\) are equipped with equivalence relations, there is of course no guarantee that the choice function, \(f\) above, is extensional in the sense that it maps equivalent element to equivalent elements. This is the failure of the extensional axiom of choice, see Martin-Löf (2009) for an analysis.