This is from an old exam:
Let $M$ be a set of functions from $\mathbb{Z}/3$ into itself. What is the least number of elements that $M$ must contain for there to surely be at least two elements $f,g \in M$ for which $f(0)=g(0)$ and $f(1)=g(1)$?
The solution goes like this:
Every function from $\mathbb{Z}/3$ into itself gives rise to a function $\bar{f}:\{0,1\} \rightarrow \mathbb{Z}/3$ by letting $\bar{f}(0)=f(0)$ and $\bar{f}(1)=f(1)$. For two functions to satisfy the conditions $f(0)=g(0)$ and $f(1)=g(1)$ it must hold that $\bar{f}=\bar{g}$. Then by the pigeonhole principle there must be at least ten functions in $M$ for these conditions to always hold.
Questions:
1) Why and how does $\bar{f}$ arise??
2) Why must the condition $\bar{f}=\bar{g}$ hold?
3) Why does the result follow from the pigeonhole principle?
I'm afraid I don't have anything of my own to contribute; in the associated literature the section (incl. exercises) regarding the pigeonhole principle does not mention a technique that looks similar to this. So, if anyone could explain the above solution further, provide alternative literature, or an alternative method of solving the problem, that'd be much appreciated, thanks!