Solution (source code)

= Solution

The <characteristic polynomial> is $(t-\tfrac12)^3$. For $N=A-\tfrac12I$, one finds $N\ne0$ but $N^2=0$, so the <minimal polynomial> is $(t-\tfrac12)^2$. Hence the invariant factors are $t-\tfrac12$ and $(t-\tfrac12)^2$, and the rational canonical form is
$$
\boxed{\begin{pmatrix}
\tfrac12&0&0\\
0&0&-\tfrac14\\
0&1&1
\end{pmatrix}.}
$$