I've tried a bunch of different groupings of the three terms so that I could use the binomial expansion forumula, but I haven't been able to go much further than that. This is an example of what I've tried so far: $$(1+x+x^2)^n=\sum_{n=0}^{\infty} {n \choose k}(1+x)^{n-k}x^{2k} =\sum_{k=0}^{\infty}\sum_{i=0}^{\infty}{n \choose k}{{n-k} \choose i}x^{2k+i}$$
I decided to show this as it has the closest looking coefficient to the expected answer, which states that the coefficient of $x^n$ is $$\sum_{k=0}^{n}{n \choose k}{{n-k} \choose k}$$. I'm assuming I'm taking the wrong approach so I'd appreciate some input.
Essentially you want as many $1$s as $x^2$s, but not more than $\frac n2$ of either
If you have $k$ of $1$s and $k$ of $x^2$s then you also have $n-2k$ of $x$s and these can be in any order so I would have written
$$\sum\limits_{k=0}^{\lfloor n/2 \rfloor} \frac{n!}{k!^2(n-2k)!}=\sum\limits_{k=0}^{\lfloor n/2 \rfloor} {n \choose k}{n-k \choose k}$$
As Mike Earnest has observed, this is the same as the expected answer since for larger $k$ you have ${n-k \choose k}=0$