Image of a Hausdorff Space with certain conditions is closed

23 Views Asked by At

Let $X$ be a Hausdorff space and let $f:X \to X$ be a continuous map such that $f \circ f=f$. Prove that $f(X)$ is closed in $X$.

I am showing its complement is open. I had chosen $x \in X \setminus f(X) $ thus $ x \neq f(x).$ then I tried to use Hausdorff Property, but I am unable to show that $ x$ is an interior point of $X \setminus f(X) $