Let $X$ be a projective variety. Assume there is an algebraic map $f: X \rightarrow X$ that is a bijection. I am thinking of $X$ as a variety, not a scheme, so by a bijection I mean a bijection on closed points. Most likely I am working over the complex numbers, so if you like I mean a bijection on complex points. Can you conclude that $f$ has an algebraic inverse?

I think this is not immediately obvious, since it is not true that any algebraic bijection between two projective varieties is an isomorphism. For instance, there is an algebraic bijection from ${\Bbb P}^1$ to a cuspidal cubic in ${\Bbb P}^2$ given by $[x,y] \rightarrow [x^3, x^2y, y^3]$. So if this is true one must use the fact that the map is from $X$ to itself.

I am interested in cases where $X$ is both singular and reducible (although is of pure dimension, if that helps), so a complete answer would cover any such case. Alternatively, if it is not true that such a map has an algebraic inverse, I would like an explicit counter example.