Let $a_1, a_2, … a_n$ be distinct numbers from the interval $[a, b]$ and let $σ$ be a permutation of ${1, 2, …, n}$. Let $a_1, a_2, … a_n$ be distinct numbers from the interval $[a, b]$ and let $σ$ be a permutation of ${1, 2, …, n}$.  Define the function $f : [a,b]  → [a, b]$ as follows:  
$f(x) = a_{σ(i)}$      if  $x=a_i,   i =$ (overbar of $1,n$)
or
$f(x) = x$     otherwise
Prove that there is a positive integer $h$ such that $f^{[h]}(x) = x$ , where $f^{[h]} = f$ o $f$ o … o $f$.  (h times)
I start from $f^{[k+1]} = f$ o $f^{[k]}$ , k≥1
so 
 $f^{[m_1+m_2]} = f^{[m_1]}$ o $f^{[m_2]}$
but I don't know how to proceed and what is the meaning of overbar of 1,n? 

Hint:
$$f^{\left[h\right]}\left(x\right)=\left\{\begin{matrix}a_{\sigma^{h}\left(i\right)}&x=a_{i}\\x&\rm else\end{matrix}\right.$$
What can you say about the permutation $\sigma^{h}$?
