I'm trying to prove that the axiom of choice is equivalent to the following statement: For any set [tex]X[/tex] and any function [tex]f:X\to X[/tex], there exists a function [tex]g:X\to X[/tex] such that [tex]f\circ g\circ f=f[/tex]. I was able to prove that the AoC implies this, but I'm having a harder time going the other direction. It seems like if you define an equivalence relation on [tex]X[/tex] where [tex]x\sim y[/tex] iff [tex]f(x)=f(y)[/tex], then the composite function [tex]g\circ f[/tex] must map everything in each equivalence class to one of its members. This seems like it's important, but we're still only choosing points for a very specific collection of subsets of [tex]X[/tex], namely the equivalence classes induced by the function. Is there a way to extend this to any collection of subsets, or am I heading in the wrong direction?