Let $X=\left\{1,2,3,4\right\}$. Consider a function $f:X\to X$. Let $f^1=f$ and $f^{k+1}=\left(f\circ f^k\right)$ for $k\geq1$. How many functions $f$ satisfy $f^{2014}\left(x\right)=x$ for all $x$ in $X$?

$\text{(A) }9\qquad\text{(B) }10\qquad\text{(C) }12\qquad\text{(D) }15\qquad\text{(E) }18$
To solve the problem, we need to determine the number of functions \( f: X \to X \) such that \( f^{2014}(x) = x \) for all \( x \in X \). This means that applying the function \( f \) 2014 times returns each element to itself. In other words, \( f \) must be a permutation of \( X \) whose order divides 2014.

1. **Identify the possible cycle lengths:**
   - The order of a permutation is the least common multiple (LCM) of the lengths of its cycles.
   - Since \( 2014 = 2 \times 19 \times 53 \), the possible cycle lengths must divide 2014. However, since \( X \) has only 4 elements, the possible cycle lengths are limited to 1, 2, 3, and 4.
   - We need to find permutations where the LCM of the cycle lengths divides 2014. Since 2014 is not divisible by 3 or 4, the only possible cycle lengths are 1 and 2.

2. **Count the permutations with cycles of length 1 and 2:**
   - **Case 1: All cycles of length 1 (Identity permutation):**
     - Here, \( f(x) = x \) for all \( x \in X \). There is exactly 1 such function.
   
   - **Case 2: Two cycles of length 2:**
     - We need to partition the set \( X = \{1, 2, 3, 4\} \) into two pairs. Each pair will form a 2-cycle.
     - The number of ways to choose 2 elements out of 4 to form the first cycle is \( \binom{4}{2} = 6 \). The remaining 2 elements automatically form the second cycle.
     - Therefore, there are 6 such permutations.
   
   - **Case 3: One cycle of length 2 and two cycles of length 1:**
     - We need to choose 2 elements out of 4 to form the 2-cycle. The remaining 2 elements will each form a 1-cycle.
     - The number of ways to choose 2 elements out of 4 is \( \binom{4}{2} = 6 \).
     - Therefore, there are 6 such permutations.

3. **Sum the number of valid permutations:**
   - Adding the number of permutations from each case, we get:
     \[
     1 + 6 + 6 = 13
     \]

The final answer is \(\boxed{13}\)