HINT $\rm\ \ \ 0\ =\ f(x)\ =\ a + x\ g(x)\ \ \Rightarrow\ \ x\ (-g(x)/a)\ =\ 1\ $ if $\rm\ a_0 \ne 0\:,\ $ e.g. $\rm\: f(x) = $ min. polynomial.
I.e. exploit the the fact that the "ring of linear operators" $\rm\: F[A] \cong F[x]/f(x)\ $ where $\rm\:f(x)\:$ is the minimum polynomial of $\rm\:A\:$ over $\rm\:F\:.$ Note that this depends crucially on the fact that the coefficients commute with $\rm\:A\:,\:$ being scalars $\rm\in F\:.$
This is just the special case $\rm\ h = x\ $ of $\rm\ (f,h) = 1\ \Rightarrow\ h^{-1} $ exists $\rm\:(mod\ f)\:$, and is computable by the extended Euclidean algorithm, since $\rm\:F[x]\:$ is a Euclidean domain. This is frequently used for the purposed of rationalizing denominators in algebraic extension fields.
More generally, one can use the same "operator" techniques to compute inverses modulo "constant" coefficient differential / difference (recurrence) operators. They are all abstractly isomorphic to working in a polynomial ring residue field $\rm\:F[x]/f(x)\:.$