If $\deg (f) \leq 3$

Case 1: If $f\in \Z_n$ (or something simple)

Check to see if $f$ has “roots” or find an $\alpha$ where $f(\alpha)=0$.

If you find a root then it means that there is a factor $x-\alpha$!

If there are no roots, then it means that it is irreducible and you are done!

Case 2: If $f\in \Bbb Q [x]$

Let $f(x)=ax^3+bx^2+c$

We know that if there is a rational root it must be of the form

$$ \frac{r} s\ st.\ s\mid a\text{ and } r\mid c $$

If a root $\alpha$ is found, then we either have a factor $x-\alpha$ or it is irreducible

If $\deg (f) > 4$