The kernel of the kernel. From Wikipedia-Entry on Equivalence Relatin:Lattices

The possible equivalence relations on any set X, when ordered by set inclusion, form a complete lattice, called Con X by convention. The canonical map ker: X^X → Con X, relates the monoid X^X of all functions on X and Con X. ker is surjective but not injective. Less formally, the equivalence relation ker on X, takes each function f: X→X to its kernel ker f. Likewise, ker(ker) is an equivalence relation on X^X.

ker ist not a function from $X \to X$, so how could it be applied to itself, for me the expression ker(ker) makes no sense?
 A: Let $X$ and $Y$ be sets, and let $\mathscr{A}={}^XY$. If $f\in\mathscr{A}$, then in this context $$\ker f=\{\langle x,y\rangle\in X\times X:f(x)=f(y)\}\in\operatorname{Con}X\;.$$ Thus, we have a map, which I’ll denote by $\ker_\mathscr{A}$, from the monoid $\mathscr{A}$, with composition as the operation, to $\operatorname{Con}X$. 
Now replace $X$ by $\mathscr{A}$ and $Y$ by $\operatorname{Con}X$: let $\mathscr{B}={}^\mathscr{A}\!\operatorname{Con}X={}^{{}\left(^XY\right)}\!\operatorname{Con}X$. There is then a map
$$\ker_\mathscr{B}:\mathscr{B}\to\operatorname{Con}\left({}^XY\right):\varphi\mapsto\left\{\langle f,g\rangle\in{}^XY\times{}^XY:\varphi(f)=\varphi(g)\right\}\;.$$
In particular, $\ker_\mathscr{A}\in\mathscr{B}$, so it makes sense to talk about $\ker_\mathscr{B}(\ker_\mathscr{A})$:
$$\begin{align*}
\ker_\mathscr{B}(\ker_\mathscr{A})&=\left\{\langle f,g\rangle\in{}^XY\times{}^XY:\ker_\mathscr{A}f=\ker_\mathscr{A}g\right\}\\\\
&=\left\{\langle f,g\rangle\in{}^XY\times{}^XY:\forall x,y\in X\Big(f(x)=f(y)\leftrightarrow g(x)=g(y)\Big)\right\}\\\\
&=\left\{\langle f,g\rangle\in{}^XY\times{}^XY:g=f\circ\pi\text{ for some permutation }\pi\text{ of }Y\right\}\;.
\end{align*}$$
You can of course specialize this to the case $Y=X$.
A: My guess is that ker(ker) is the map $\text{ker} : (X^X)^X \rightarrow \text{Con} (X^X)$.
In general, for any sets $Y$ and $Z$, there is a map $\text{ker} : Y^Z \rightarrow \text{Con}(Y)$ which associates to a function $f : Y \rightarrow Z$ the equivalence relation on $Y$ defined by $y \equiv y' \Leftrightarrow f(y) = f(y')$.
