We have a surjective function $f:A\rightarrow A$ and we know that $f\circ f=f$.
How do I prove that $f=id_A$?
We have a surjective function $f:A\rightarrow A$ and we know that $f\circ f=f$.
How do I prove that $f=id_A$?
Let $x \in A$. Then since $f$ is surjective, there exists a $y \in A$ such that $$f(y)=x$$
This implies $$f(f(y))= f(y)$$
$$f(x)=x$$
Since our choice of $x$ was arbitrary, we're done.