Demystifying Arjun's explanation on "why each function must be onto":
1) Let f(i) = j. Now we have f(j) = i , as per the given condition f(f(i)) = i.
2) Since, f(i) = j for 0 $\leq$ i $\leq$ 2014,
=> i must take all 2015 possible values.
(why?  Recall,as per the definition of the function, each element in the domain
must be mapped to some element in the codomain. )
3) From the definition of the function, we know that
this is not allowed.


V
4) As per the given condition,
this is not allowed.


V
(Why??  Let's take an example: let f(2) = 3 and f(5) = 3 and f(3) = 2
then, f( f(2) ) = f( 3) = 2 (which is ok)
but f ( f(5) ) = f(3) = 2 (violation of the given condition.)
( as per given condtion, f (f(5) ) should be 5 )
)
//Refer pt. 3 if you are wondering why f(3) = 2 and f(3) = 5 both can't be true.
5) Taking conditions mentioned in pt. 3 and pt. 4 into consideration, only possibility left is of onetoone mapping.
6) So, this is what we know:
domain has 2015 elements.
Codomain has 2015 elements.
only onetoone mapping is allowed.
Do you smell bijection??