Would this theorem also work for any integer $n$, not necessarily a prime ? 
Would this theorem also work for any integer $n$, not necessarily a prime ?


I don't see why it should not, can you verify it or do you have an counterexample for a nonprime integer ?

In short, it depends on the notion of irreducibility.
In a commutative rings that are not domains, there are problems with divisibility - or, the situation is simply a bit more complicated: one gets several different notions of associated elements, thus, several notions of irreducible elements, etc. 
Just to demonstrate: In this case what can go wrong is that in general $\mathbb{Z}_n[x]$, it is no longer true that $fg=h$ implies $\deg f, \deg g \leq \deg h$. For example, over $\mathbb{Z}_8[x],$ one has
$$(4x^2+4x+2)(4x^{100}+4x+2)=4.$$
Thus, from the fact that $\bar{f}(x)$ has bigger degree than, say $\bar g(x)$, it does not simply follow that $\bar{f}(x)$ does not divide $\bar g(x)$.
So one must treat this more carefully. I am, however, convinced, that if done right, the statement will hold even for general $n$. (I can give more details if anyone wishes.)
