I know if a function $f: X \to Y$ is bijective, it is open iff it is closed as both are equivalent to $f^{-1}$ being continuous.
Now I wonder if a function $f$ on two topological spaces is open and closed, must it be bijective? Furthermore, can it be neither injective nor surjective?
I suspect that there is some easy counterexample, but I cannot think of any.