Ring homomorphism $f: \Bbb{Z}_p[X] \to \Bbb{Z}_p^{n\times n}$. Prove it is never bijective and find the amount of elements in Im$(f)$. Let $f: \mathbb{Z}_p[X] \to \mathbb{Z}_p^{n \times n}$
with $n \geq 2$ be a ring homomorphism with $f(1) = I_n, f(X) = M$.
a) Prove it is never injective and never surjective.
b) Find the minimal polynomial and the amount of elements $ \operatorname{Im}(f)$ with $p=3, n=6$ and with $M$ given:
$f(X)= M  = \left( \begin{matrix} 2 & 0 & 0 & 0 & 0 & 0 \\ 1 & 2 & 0 & 0 & 0 & 0 \\ 0 & 1 & 2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 2 & 0 & 0 \\ 0 & 0 & 0 & 1 & 2 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 \end{matrix} \right).$

a) I first proved that $f$ is fully determined by $f(X)$.
$f(p(X)) = f(\sum_{i=1}^n a_iX^i) = \sum_{i=1}^n f(a_i)f(X^i) =  \sum_{i=1}^n a_if(X)^i$, so we see that indeed $f$ is determined by the value of $f(X)$. (These operations are allowed since $f$ is a ring homomorphism).
Then I tried proving that it is never injective.
Since $M \in \mathbb{Z}_p^{n \times n}$, I know that there exists a $q \in \mathbb{N}$ such that $M^q = 0$ with $q$ a divisor of $p$.
Consider $p(X) = X^i$, then $f(p(X)) = p(f(X)) = p(0) = 0$, which means that $p(X) \in \text{ker}(f)$ and since the kernel is not equal to $\{0\}$ we know it is not injective.
I am not sure how to prove that it is never surjective.
b) I think that the minimal polynomial is equal to $\phi_M(X) = (X-2)^2(X-1)$ since there are 2 Jordan blocks for eigenvalue 2 and 1 for eigenvalue 1.
I don't really know how to calculate the amount of elements that $ \operatorname{Im}(f)$ has.
 A: For a): Your proof of injectivity is not correct. For example if $M$ is the identity matrix, then $M^k=I\ne0$ for all $k$. One way would be to argue via cardinalities: $\Bbb Z_p[X]$ is infinite while $\Bbb Z_p^{n\times n}$ is finite, so ....
A bit cleaner/more general argument would be to look at the dimension. $\Bbb Z_p^{n\times n}$ has dimension $n^2$, hence the set $\{I,M,\dots,M^{n^2}\}$ is linearly dependent, so there are coefficients $a_0,\dots,a_{n^2}$, not all equal to $0$, such that $$a_0I+\dots+a_{n^2}M^{n^2}=0$$ Now see how you can make a non-zero polynomial $p$ out of this such that $p(M)=0$.
Hint for the surjective part: $\Bbb Z_p[X]$ is commutative while $\Bbb Z_p^{n\times n}$ is not.
For b): For the minimal polynomial you need to look at the size of the largest Jordan block for each eigenvalue and not the number of Jordan blocks.
Assume that we found the minimal polynomial $\phi$ and say it is of degree $d$. We know that $\ker f=\langle\phi\rangle$, hence $$\operatorname{im} f\cong \Bbb Z_p[X]/\langle\phi\rangle$$
In general for a field $K$ and a polynomial $p$ over $K$ of degree $n$ we have that $K[X]/\langle p\rangle$ is a $K$-vector space of dimension $n$ (if you don't know this try to prove this, e.g. by explicitely writing down a basis). So in this case we know that $\operatorname{im} f$ is a $\Bbb Z_p$-vector space of dimension $d$. What does this tell us about the cardinality?
A: A ring homomorphism $\mathbb{Z}_p[X]\to\mathbb{Z}_p^{n\times n}$ can be surjective, precisely when $n=1$. In this case, send a polynomial to its constant term.
For $n>1$ such a homomorphism cannot be surjective, because the domain is commutative and the codomain isn't.
So this generalizes to the case $A[X]\to A^{n\times n}$, where $A$ is any commutative ring.
Proving that such a homomorphism cannot be injective is the same as proving that for every $M\in A^{n\times n}$, there is a nonzero polynomial $a_0+a_1X+\dots+a^kX^k$ such that
$$
a_0I+a_1M+\dots+a_kM^k=0
$$
This is easier when $A$ is a field, because in this case the set $\{I,M,\dots,M^{n^2}\}$ has more elements than the dimension of $A^{n\times n}$ as $A$-vector space; a nontrivial linear combination will provide the required polynomial.

For general commutative rings one can observe that Hamilton-Cayley holds, but this requires proving it. If you know a proof for matrices over a field, then you can consider the field of fractions $F$ of $\mathbb{Z}[X_{ij}:1\le i,j\le n]$ (polynomials over $n^2$ indeterminates). Let $\xi$ be the matrix having $X_{ij}$ as its $(i,j)$ entry. Then the characteristic polynomial $p(X)$ of $\xi$ (where $X$ is another indeterminate) is a polynomial in $\mathbb{Z}[X_{ij},X]$ and we know that $p(\xi)=0$. Given a matrix $M=(m_{ij})\in A^{n\times n}$, consider the homomorphism $\mathbb{Z}[X_{ij}]\to A^{n\times n}$ defined by $X_{ij}\mapsto m_{ij}$ and finish up.
