Suppose that for all $g : A \to A$ , $f \circ g = f $. To prove that $f$ is constant function
I tried to work by contradiction by letting $x_1, x_2 \in A $, $x_1 \neq x_2$ such that $f(x_1) \neq f(x_2)$
$(f \circ g) (x_1) = f(x_1)$
$(f \circ g) (x_2) = f(x_2)$
$\exists c_1$ such that $(x_1,c_1) \in g$ and $(c_1, f(x_1)) \in f$
$\exists c_2$ such that $(x_2,c_2) \in g$ and $(c_2, f(x_2)) \in f$
How do i solve ? Thanks