Determining Involutary Keys in Substitution Ciphers How would I be able to show that a key $K=(a,b)$ is involutary for an Affine Cipher over the integers modulo n?

Similarly, is there a way to generalize the conditions for a key to be involutary for a substitution cipher?

(Involutary keys are keys for which the encryption function is equal to the decryption function $e_K=d_K$)
If $E(x) = ax+b \bmod n$, and $E(E(x)) = x$, then you need $a(ax+b)+b = x$, or $a^2x + ab + b = x$.  So any (a, b) where $a^2 = 1$ and $b(a+1) = 0$ will do it.  There are always solutions $(1, 0)$ (which corresponds to not encrypting) and $(-1, b)$.  Depending on the value of $n$ there may be other solutions for $a$.  There are only those two for $n = 26$, but there are a total of 4 solutions for $n = 36$.