Suppose $A$ is a nonempty set and $f: A \rightarrow A$ and for all $g:A \rightarrow A,$ $f \circ g = f$. Prove that $f$ is a constant function.
This result seems obvious, but I can't seem to find a way to prove it. The book I got this problem from hinted that the reader should consider what would happen if $g$ were a constant function. I considered that case and it was easy to prove that $f$ was a constant function, but I can't find any way to prove it when $g$ is not a constant function. At this point I'm not really sure how to approach this problem anymore. Thanks in advance for any help!