'Fixed Point' Irrationals
The function $f$ is invertible, in fact it is its own inverse, and is therefore a bijection. Therefore the images of the (uncountably many) irrationals cannot be only the (countably many) rationals.
If $f(f(x))=x$ for every $x\in\mathbb R$, then $f$ is one-to-one.
If $f$ is one-to-one then the set $\{f(x) : x\text{ is irrational}\}$ is uncountably infinite. Therefore that set cannot be a subset of the set of all rational numbers.
The condition is $f\circ f$ is the identity, and thus $f^{-1}=f$, and in particular $f$ is injective. If $f(x)$ was rational for every irratioanl $x$, then restricting $f$ to the set of irrationals, one would obtain an injection into the set of ratioanls. That is impossible though due to cardinalities.