We are given:
\[
f(x) = \frac{1 - x + x^2}{1 + x + x^2}
\]
Let’s try to simplify and find the minimum value by using a substitution.
Step 1: Let \( x = \tan \theta \)
Then,
\[
f(x) = \frac{1 - \tan \theta + \tan^2 \theta}{1 + \tan \theta + \tan^2 \theta}
\]
Now divide numerator and denominator by \( \cos^2 \theta \) (to convert into trigonometric identities):
\[
= \frac{\cos^2 \theta - \sin \theta \cos \theta + \sin^2 \theta}{\cos^2 \theta + \sin \theta \cos \theta + \sin^2 \theta}
\]
Step 2: Let \( x = t - 1 \) (a substitution to simplify symmetry)
Then,
\[
f(t - 1) = \frac{1 - (t - 1) + (t - 1)^2}{1 + (t - 1) + (t - 1)^2}
\]
Simplify numerator:
\[
1 - t + 1 + (t^2 - 2t + 1) = t^2 - 2t + 3
\]
Simplify denominator:
\[
1 + t - 1 + (t^2 - 2t + 1) = t^2 - 2t + t + 1 = t^2 - t + 1
\]
So,
\[
f(t - 1) = \frac{t^2 - 2t + 3}{t^2 - t + 1}
\]
\[
f(t) = \frac{t^2 - 2t + 3}{t^2 - t + 1}
\]
Let’s assume \( f(t) = k \), then:
\[
\frac{t^2 - 2t + 3}{t^2 - t + 1} = k
\Rightarrow t^2 - 2t + 3 = k(t^2 - t + 1)
\]
\[
t^2 - 2t + 3 = kt^2 - kt + k
\Rightarrow t^2(1 - k) + t(-2 + k) + (3 - k) = 0
\]
For minimum or maximum value, the quadratic must have real roots, so:
\[
\text{Discriminant } D \geq 0
\]
Discriminant:
\[
(-2 + k)^2 - 4(1 - k)(3 - k) \geq 0
\]
\[
k_{\min} = \frac{1}{3}
\]
Hence, the minimum value of the function is:
\[
\boxed{\frac{1}{3}}
\]