this is sort of cheating but the way I do it is recognizing that the coefficients are a line of Pascal's Triangle
and thus they are binary coefficients.
That means that
x3+3x2+3x+1=(x+1)3
I doubt they expect you to know that so you'll have to use the rational root theorem.
Given the coefficients of x3 and 1 we know the only possible rational roots are ±1
f(1)=1+3+3+1=6≠0f(−1)=−1+3−3+1=0so -1 is a root
so x+1 is a factor we then divide x3+3x2+3x+1x+1=x2+2x+1The result has the same possible two roots so we check as beforex2+2x+1|x=1=4≠0x2+2x+1|x=−1=0again (x+1) is a factor we again we dividex2+2x+1x+1=x+1and we see all 3 factors are x+1 i.e.f(x)=(x+1)3
And thus there is a single root, x=-1, that is repeated 3 times.