This bijective map is continuous?

Let $$f:X\rightarrow X$$ a bijective map between topological spaces (the same space X). A priori not known to be continuous. If we know $$f\circ f=id$$ does it mean that $$f$$ has to be continuous map and hence a homeomorphism ?

No. For instance, consider the topological space $$X = \{a, b\}$$ with the topology $$\tau = \{\varnothing, \{a\}, X\}$$ and the bijection $$f:X\to X$$ with $$f(a) = b, f(b) = a$$.
Then $$f^{-1}(\{a\}) = \{b\}$$ is not open, so $$f$$ is not continuous.
For a more "interesting" example (i.e. closer to something you may reasonably encounter more often), consider $$X = \Bbb R$$ with the standard topology, and $$f(x) = \cases{\frac1x & if x<0\\x&otherwise}$$ which is a discontinuous, self-inverse bijection.
If $$X$$ is the Sorgenfrey line $$\Bbb S$$, i.e. $$\Bbb R$$ in the topology generated by the sets $$[a,b)$$ (aka as the lower limit topology) and $$f(x)=-x$$ then $$f$$ is self inverse but continuous at no point, while $$X$$ is hereditarily normal etc., so quite nice.