Why is $x^4-3x^2+18$ irreducible over the $3$-adics?
As others have explained $f(x)$ has no zeros in $\Bbb{Q}_3$ because $x^2-3x+18$ doesn't have any. Therefore the remaining possibility is that $f(x)=g(x)h(x)$ is the product of two irreducible monic quadratics, $g(x),h(x)\in\Bbb{Q}_3[x]$.
For another way to a contradiction consider the following. The polynomial $f(x)$ is even. Implying that if $g(x)\mid f(x)$ then also $g(-x)\mid f(-x)=f(x)$. In other words, $g(-x)$ is also an irreducible monic factor of $f$. The same applies to $h(-x)$ as well. We have two possibilities:
- If $g(-x)=g(x)$ and $h(-x)=h(x)$, then $g(x)$ and $h(x)$ are both even. That is, $g(x)=x^2-a, h(x)= x^2-b, a,b\in\Bbb{Q}_3$. Then $a$ and $b$ would be zeros of $x^2-3x+18$, which is absurd.
- If $g(-x)=h(x)$ (when automatically also $h(-x)=g(x)$) then we run into the following problem. If $g(x)=x^2+a_1x+a_2$, then $g(-x)=x^2-a_1x+a_2$, and $$f(x)=g(x)g(-x)=x^4+\cdots+a_2^2.$$ So $18=a_2^2$. But this is impossible, because $18=2\cdot3^2$, and there is no $\sqrt2$ in $\Bbb{Q}_3$.
No factorization exists, so $f$ is irreducible.
The polynomial $x^2 - 3 x + 18$ is irreducible over $\mathbb{Q}_3$. Consider the quadratic extension $F=\mathbb{Q}_3[\sqrt{-7}]$ over which it decomposes as $(x-x_1)(x-x_2)$. So we have $$x^4 - 3 x^2 + 18= (x^2-x_1)(x^2 - x_2)$$ Now it is enough to see that $(x^2 - x_1)$, $(x^2 -x_2)$ are irreducible over $F$, equivalently $x_i$ are not squares in $F$.
Consider the extension of the valuation $v_3$ to $F$. We have $v_3(x_i) = 1$. It is easy to see that there are no elements in $F$ of value $\frac{1}{2}$.
Note: the extension of the valuation $v_3$ to $F$ is $v(a + b \sqrt{-7}) = \frac{1}{2}v_3(a^2 + 7 b^2)$
Well, here’s an argument that uses a somewhat non-elementary fact about $p$-adic field extensions, namely that if the residue-field extension degree is $f$ and the ramification degree is $e$, then the total degree $n$ is $n=ef$. This $f$ is also the degree over the base field of the maximal unramified intermediate extension.
I’m about to show that if $\alpha$ is a root of $F(x)=x^4-3x^2+18$, then the extension $\Bbb Q_3(\alpha)\supset\Bbb Q_3$ has $f$ and $e$ both equal to $2$, so that $[\Bbb Q_3(\alpha):\Bbb Q_3]=4$. This shows that your polynomial $F$ is irreducible.
You’ve already seen that $G(x)=x^2-3x+18$ has $\alpha^2=\gamma$ for a root, and as I’ve pointed out in a comment, $\gamma/3$ is a root of $x^2-x+2=g(x)$. Use the Quadratic Formula to see that to get roots of $g$, you need $\sqrt{-7}$, and since $x^2+7\equiv x^2+1\pmod3$, adjoining $\sqrt{-7}$ is same as adjoining $i$ to $\Bbb Q_3$, giving the quadratic unramified extension of $\Bbb Q_3$. So $f=2$ for the extension $\Bbb Q_3(\gamma)\supset\Bbb Q_3$.
Since the roots of $g(x)$ are $3$-adic units (the constant term of the minimal polynomial is a unit), we have $v_3(\gamma)=1$, as @RobertIsrael has shown by different methods. This means that $v_3(\alpha)=v_3(\sqrt\gamma\,)=1/2$, which in turn means that the ramification degree $e$ of $\Bbb Q_3$ over $\Bbb Q_3$ is at least two. Thus we have $f\ge2$, $g\ge2$, and their product $n$, the degree of the minimal polynomial for $\alpha$ over $\Bbb Q_3$, is $\le4$. It follows that all three inequalities are equalities, and $F$ is irreducible.