12. $k$ is a real number, let $f(x)=\frac{x^{4}+k x^{2}+1}{x^{4}+x^{2}+1}$. If for any three real numbers $a, b, c$ (which can be the same), there exists a triangle with side lengths $f(a) 、 f(b) 、 f(c)$, then the range of $k$ is $\qquad$
12. $-\frac{1}{2}f(c) \\ f(a)>0\end{array}\right.$, so $\left\{\begin{array}{l}2 f_{\min }(x)>f_{\max }(x) \\ f_{\min }(x)>0\end{array}\right.$.
From the problem, we get $f_{\max }(x)=\left\{\begin{array}{ll}\frac{k+2}{3}, & k>1 \\ 1, & k \leqslant 1\end{array} ; f_{\min }(x)=\left\{\begin{array}{ll}1, & k>1 \\ \frac{k+2}{3}, & k \leqslant 1\end{array}\right.\right.$.
When $k>1$, the solution is $k-\frac{1}{2}$.
In summary, the range of $k$ is $-\frac{1}{2}<k<4$.