( with $\mathbb{Z}_n$ I mean $\frac{ \mathbb{Z} }{ n\mathbb{Z} }$ )
Theorem :
Let $\psi,\phi \in \mathbb{K}[x]$ be such that
$$\psi(\phi(x)) = x = \phi(\psi(x)) \; \forall x \in \mathbb{K}$$
Then there exists $m,q \in \mathbb{K}$
$$\psi(x) = mx + q \; \forall x \in \mathbb{K}$$
A way to prove this would be this one :
Let $\psi(x) = a_0 + a_1 + \dots + a_nx^n$ and $\phi(x) = b_0 + b_1x + \dots + b_mx^m$ with $a_n \neq 0 \neq b_m$. Suppose by contradiction that $n \geq 2$, then $n^m \geq 2$
$$x = \phi(\psi(x)) = (\text{part of degree } \leq n^m - 1 ) + b_m(a_n)^m x^{n^m}$$
But this is a contradiction because if two polynomials are equal all the coefficients need to be equal so $b_m(a_n)^m = 0$ but I know that $b_m(a_n)^m \neq 0$.
The problem with this proof is that It works only on infinite fields $\mathbb{K}$
Take for example $\mathbb{Z}_3$, then the polynomials
$$\psi(x) = x^3$$ $$\phi(x) = x$$
Are inverses of each other, but $\psi$ is of degree $3$, In fact I have that
$$x = x^3 \; \forall x \in \mathbb{Z}_3$$
but clearly the coefficients aren't equal.
My question is : how can I prove the theorem?