My attempt: a function $h(x,t) = tf(x) + (1-t)g(x)$ (i.e. the straight-line homotopy) would work with any $f$ and $g$.
Is this too simple? It seems like the straight-line homotopy works in a lot of situations. Are there anything special about the spaces X and I in this case that makes the straight-line homotopy works?

You are correct, but just for the sake of completeness and "being sure of oneself", I've tried to dissect this.
Given two continuous functions $f, g : X \longrightarrow I$, you want to show that there is some continuous function $H: X \times I \longrightarrow I$ with $H(x, 0) = f(x)$ and $H(x, 1) = g(x)$. This would show that any two continuous functions mapping $X$ to $I$ are homotopic, and hence the set of $\mathcal C(X,I)$ of continuous functions from $X$ to $I$ has a single homotopy type $($ie, $[X, I]$ has a single element$)$.
Your proposal $H(x,t) = (1-t)\,f(x) + t\,g(x)$ clearly satisfies $H(x,0) = f(x)$ and $H(x,1) = g(x)$. Moreover, for any $(x,t)\in X\times I$ we have
$$0 \leq \min \{f(x), g(x)\} \leq H(x, t) \leq \max \{f(x), g(x)\} \leq 1$$
so $H(x,t) \in I$. It follows that $H: X \times I \longrightarrow I$ as required, and it's easy to check from the formula that it is continuous, which completes the proof.