Key Idea $\ $ Composite polynomials take composite values (except for finitely many values)
Indeeed, suppose that $\ f(x)\color{#c00}{\ne 0}\ $ is a composite polynomial: $\, f(x) = g(x)h(x)\,$ with $\ g,\,h\color{#c00}{\ne \pm1}.\,$ Then $\, f(n) = g(n)h(n)\, $ is a composite integer if $\,g(n),\,h(n)\,\neq\, 0,\,\pm1.\,$ The possible exceptions to this are $ $ finite $ $ in number: $ $ when $\,n\,$ is a root of $\ g,\, h,\, g\pm1,\,$ or $\, h\pm1, \, $ all of which are $\color{#c00}{nonzero}$ polynomials, hence have finite sets of roots. $\ $ QED
Remark $\ $ For a specific composite polynomial $\,f = gh\,$ this yields a simple algorithm to enumerate its finitely many prime values: test if $\,f(n)\,$ is prime as $\,n\,$ ranges over the roots of $\,g\pm1\,$ or $\,h\pm1.\,$ Applying this to $\, f = x^3-1 = (x-1)(x^2\!+x+1)\,$ quickly yields the sought result.
Hence the method used in the other answers is a special case of a method that works generally. Furthermore, this is an instance of a general philosophy relating the factorizations of polynomials to the factorizations of their values (see said answer for much more on this viewpoint).