I'm looking for a function $f : \mathbb{Z} \rightarrow \mathbb{Z}$ such that $f(f(x)) = x$ and $f(1) = 2$. In particular, I don't want this function to be a piecewise function. Does such a function even exist?
For example, I can define the above function as follows:
\begin{equation} f(x) = \begin{cases} 2 & x = 1 \\ 1 & x = 2 \end{cases} \end{equation}
However, I was wondering whether there's a way to define this function without writing conditions.
$3-x$ (plus enough characters to qualify as an answer).