Which of these characteristic polynomials imply that the matrix can split? This a paraphrase of another old exam problem:

Let $M$ be a $\:5\times 5\:$ matrix with rational entries whose characteristic polynomial takes
  the form $\;\left(x^{\hspace{.02 in}2}+1\right) \cdot \left(x^3+x+q\right)\:\:$. $\;\;\;\;$ For which rational values of $q$, if any, is it
  
  possible that there is no invertible matrix $A$ with rational entries such that $\:A^{-1} M\hspace{.02 in}A$
  
  has block diagonal form with a $\:2\times 2\:$ block and a $\:3\times 3\:$ block? $\;\;\;$ Justify your answer.


I suspect this involves Jordan normal form, especially when $\:q=0\:$ so that the

characteristic polynomial has a repeated factor, but I have no other clue of how to proceed.
How would one do that problem?
 A: You are indeed right. If $q \ne 0$, then $x^{2} + 1$ and $x^{3} + x + q$ are coprime, so you get the two blocks of dimension $2$ and $3$. 
This is because of the general fact that if $M$ is a matrix, $g = h k$ a polynomial, with $(h, k) = 1$, and $g(M) = 0$, then the underlying vector space $V$ is the direct sum of the kernel $V_{1}$ of $h(M)$ and the kernel $V_{2}$ of $k(M)$. Thus, the restriction $M_{1}$ of $M$ to $V_{1}$ satisfies $h(M_{1}) = 0$, and the restriction $M_{2}$ to $V_{2}$ satisfies $k(M_{2}) = 0$. 
In this particular case, $g$ is the characteristic polynomial, $h = x^{2} + 1$ and $x^{3} + x + q$, with $q \ne 0$. It is not difficult to see that $V_{1}$ must have dimension at least $2$ (because it is on $V_{1}$ that the roots of $h$ occur as eigenvalues) and $V_{2}$ dimension at least $3$, for the same reason. So they have dimensions precisely $2$ and $3$.
If $q = 0$, then take for $M$ the rational canonical form for the polynomial $f = (x^{2} + 1) (x^{3} + x) = x (x^2 + 1)^2 = x^5 + 2 x^3 + x$, which is
$$
M = 
\begin{bmatrix}
0 & 1 & 0 & 0 & 0\\
0 & 0 & 1 & 0 & 0\\
0 & 0 & 0 & 1 & 0\\
0 & 0 & 0 & 0 & 1\\
0 & -1 & 0 & -2 & 0 \\
\end{bmatrix}
$$
(or the transpose, according to your conventions). 
This matrix $m$ has $f$ as the minimal polynomial.
If you could put $M$ in block diagonal form, with a $2 \times 2$ and a $3 \times 3$ block, then the minimal polynomial would be $x (x^2 + 1)$
