In order to prove
$C_{M}(X) \cong \dfrac{\mathbb{F}_{q}[t]}{(f)}, \tag 1$
we first establish that $C_M(X)$ consists precisely of all matrices in $M_n(\Bbb F_q)$ which may be expressed as polynomials in $X$; the exact result needed may be found in
this Wikipedia article on commuting matrices, where it is affirmed that if the characteristic and minimal polynomials of $X$ coincide, then any matrix $A$ satisfying
$AX = XA \tag 2$
is expressible in the form
$A = p(X), \tag 3$
for some
$p(t) \in \Bbb F_q[t]; \tag 4$
invocation of this result allows us to infer that
$C_M(X) = \{r(X) \mid r(t) \in F_q[t] \}. \tag 5$
With such a description of $C_M(X)$ in hand, we may define a homomorphism
$\phi: \Bbb F_q[t] \to C_M(X) \tag 6$
via
$\phi \left ( \displaystyle \sum_0^m r_j t^j \right ) = \displaystyle \sum_0^m r_j X^j. \tag 7$
I leave it to my readers to verify that the function $\phi$ is in fact a homomorphism; the algebraic details, though a tad tedious, are straightforward. We next observe that, based upon the above remarks,
$\phi$ is in fact surjective, and thus (6) immediately yields an isomorphism $\bar \phi$ induced by $\phi$:
$\bar \phi: \dfrac{\Bbb F_q[t]}{\ker \phi} \cong C_M(X); \tag 8$
it remains to identify $\ker \phi$. Now $\Bbb F_q[t]$ is a principal ideal domain, as is well-known; therefore we may write
$\ker \phi = (g(t)), \tag 9$
for some
$g(t) \in \Bbb F_q[t]; \tag{10}$
now since
$f(X) = 0, \tag{11}$
we have
$f(t) \in (g(t)) \Longrightarrow g(t) \mid f(t); \tag{12}$
furthermore, since $f(t)$ is minimal for $X$, we must have
$f(t) \mid g(t) \tag{13}$
as well, as may be seen by applying Euclidean division of polynomials to $f(t)$ and $g(t)$: we write
$g(t) = q(t) f(t) + r(t), \tag{14}$
where $q(t), r(t) \in \Bbb F_q[t]$ with either $r(t) = 0$ or
$\deg r(t) < \deg f(t); \tag{15}$
but if
$r(t) \ne 0, \tag{16}$
then (14) yields
$r(X) = g(X) - q(X)f(X) = 0,\tag{17}$
contradicting the minimality of $f(X)$; therefore $r(t) = 0$ and (13) binds, which together with (12) forces
$g(t) = f(t); \tag{18}$
thus
$\ker \phi = (f(t)), \tag{19}$
and we finally see that (8) becomes
$\bar \phi: \dfrac{\Bbb F_q[t]}{(f(t))} \cong C_M(X), \tag{20}$
the desired isomorphism. $OE\Delta$.