Composition of mappings, composition table I have a several questions on the following problem.
Let X = {1,2}. There are 4 mappings from set X to itself, denoted End(X) and all the compositions betwen them are defined. If we denote f $\in$ End(X) as a 2-letter word (f(1), f(2)) (note: viewing images of mappings as words of length n, made from letters of an m-word alphapet, where a word is any combination of letters, was discussed in a previous exercise), then those 4 endomorphisms will be written as the following "words":

(1,1), (1,2) = $Id_X$, (2,1), (2,2)

The table for g $\circ$ f is below (g vertical and f horizontal):
\begin{array}{|c|c|c|c|}
\hline
g/f& (1,1) & (1,2) & (2,1) &(2,2)  \\ \hline
 (1,1)& (1,1) & (1,1)& (1,1)&(1,1) \\ \hline
 (1,2)& (1,1) & (1,2)&(2,1) &(2,2) \\ \hline
 (2,1)& (2,2) &(2,1) &(1,2) &(1,1)\\ \hline
 (2,2)& (2,2)  & (2,2)& (2,2)& (2,2)\\ \hline
\end{array}
The first question is on the (f(1), f(2)) "word". It can output 4 different values: (1,1), (1,2), (2,1), (2,2), which are all the elements of the set End(X). However, I don't understand why only (1,1) and (1,2) are chosen in the definition, both relating to f(1)

(1,1), (1,2) = $Id_X$, (2,1), (2,2)

Also I don't get how the mapping works, e.g. when g = (2,1) and f = (1,1), g $\circ$ f = g( (1,1) ) = (2,2). In a function, g(f(1))= g(1) would be undefined, since there 1 is not in g's first coordinate. So I'm assuming the definition defines this, although I don't understand when either (1,1) or (1,2) equals either of $Id_X$/(2,1)/(2,2).
 A: I am not entirely sure that I understand the questions, so I will just discuss the four maps in detail. For this purpose let $v,w,x,y:X\rightarrow X$ be given by
\begin{align*}
v(1)&=1,\quad v(2)=1,\\
w(1)&=1,\quad w(2)=2,\\
x(1)&=2,\quad x(2)=1,\\
y(1)&=2,\quad y(2)=2.
\end{align*}
On the other hand, let $v'=(v'_1,v'_2)=(1,1)$, $w'=(w'_1,w'_2)=(1,2)$, $x'=(x'_1,x'_2)=(2,1)$, $y'=(y'_1,y'_2)=(2,2)$.
Notice that $v'_1=1=v(1)$, $v'_2=1=v(2)$, further $w'_1=1=w(1)$, $w'_2=2=w(2)$, also $x'_1=2=x(1)$, $x'_2=1=x(2)$ and finally $y'_1=2=y(1)$, $y'_2=2=y(2)$. So, there is a clear correspondence between these functions and words (or points, as I would call them, in $\mathbb R^2$). From this perspective, it does not matter at all if you think of $v$ as a function and use the functional notation $v(1)=1$, or as a word $v=v'$ and use the subscript notation $v_1=1$.
It is pointed out that $(1,2)$ is the identity. This means $\mathrm{id}_X=w$ as a function, or $\mathrm{id}_X=w'$ as a word. Hence, the four endomorphisms are listed as $(1,1),(1,2)=\mathrm{id}_X,(2,1),(2,2)$.
Recall the composition of functions, say for $f=y\circ x$ we have $f(1)=y(x(1))=y(2)=2$ and $f(2)=y(x(2))=y(1)=2$, meaning that $f=y$.
I would say that it is less common to compose words like this, but using the correspondence above we can also consider $(2,2)\circ(2,1)=y'\circ x'=y\circ x=y=y'=(2,2)$, to make sense of this expression.
