Reduction modulo p I am going to begin the Tripos part III at Cambridge in October (after going to a different university for undergrad) and have been preparing by reading some part II lecture notes. 
Here is an extract from some Galois theory notes:
'$f(X) = X^4 + 5X^2 − 2X − 3 = X^4 + X^2 + 1 = (X^2 + X + 1)^2$ (mod 2)
$f(X) = X^4 + 5X^2 − 2X − 3 =X^4 + 2X^2 + X = X(X^3 + 2X + 1)$ (mod 3) 
So f is irreducible, since f = gh implies deg g = 1 or deg g = 2, which is impossible by
reduction modulo 2 and 3, respectively.'
Could someone please explain the last sentence? Why is deg g=1 or 2 impossible by reduction modulo 2/3?
Thank you in advance.
 A: If $f$ is reducible, then in particular $f$ is reducible modulo every prime $p$ – since $$f(x)=g(x)h(x) \implies f(x) \equiv g(x)h(x) \pmod p $$for every $p$.
So if $f=gh$ where deg $g$ = $1$, then modulo $2$ we would expect $f$ to have a degree $1$ factor. Since this is not the case, we cannot have deg $g = 1.$
Similarly, if deg $g = 2$, then we would expect $f$ to have factors with degrees summing to  $2$ modulo $3$. Since this is not the case, we cannot have deg $g=2$ - so $f$ is irreducible.
As a side point, if you haven't discovered it yet, this website has a large collection of notes based on the Cambridge Tripos that may be worth looking at!
A: If a polynomial is irreducible modulo $p$, then it is irreducible over the integers, for a factorization over the integers would induce a factorization modulo $p$.
A polynomial of degree $2$ or $3$ is irreducible over a field $F$ if and only if the polynomial has no zeros in the field.
By "trying everything" we can verify that $x^2+x+1$ has no zeros modulo $2$, and that $x^3+2x+1$ has no zeros modulo $3$. 
A: First, note that if a polynomial $f$ is reducible, then you could witness these same factors modulo any prime. For instance, $x^2 - 1$ is reducible, and we see this mod 2: $(x+1)^2$ and mod 3: $(x+1)(x+2)$. Of course, it is possible that an irreducible factor of $f$ were further reduced mod $p$, for instance $x^2+1$ will appear as $(x+1)^2$ mod $2$.
Thus, if $f$ has an irreducible factor of degree $n$ it means that modulo any prime $p$ there must be a subset of the reducible factors such that the degree sum up to $n$.
In this particular case if $f$ were reducible, it would have a factor of degree $2$ or $3$. (Linear factors are easily found using the rational root test.(°)) But no subset of the irreducible factors mod $2$ sums up to $3$; whereas no subset of the degrees of the irreducible factors mod $3$ sums op to $2$. (°°) So this is impossible.

(°) As Mathmo123 writes in his answer: it is also clear from the factorization mod 2 that there could not be a linear factor. 
(°°) See the answer by André Nicolas for why the factors of $f$ are indeed irreducible.
A: Hint $\ 4$ is the only partition of $4$ having common refinements $2+2$ and $1+3$
