Prove that $$0 \le xy+yz+xz - 2xyz \le 7/27, \:\:\:x,y,z \ge 0$$ with $x+y+z=1$.
Attempt:
We must prove $xy + yz + xz \le 2xyz + 7/27$
Assume $x,y,z>0$, since the case when all equal $0$ is clear.
Next, I have that $xy = \sqrt{x^{2}} \sqrt{y^{2}} \le (x^{2} + y^{2})/2$ by AM-GM. Same also for the $yz, xz$. Summing the inequalities we get $$ xy+ yz + xz \le x^{2} +y^{2} +z^{2} $$
Ley $\alpha =xy+yz+xz$, now
$$ x^{2} +y^{2} +z^{2} =(x+y+z)^{2} - 2 \alpha$$ so we also have $$ 3 \alpha \le 1 \implies \alpha \le 1/3= \frac{9}{27}.$$
Also $xyz \le (x+y+z)^{3}/27 = 1/27$ (by AM-GM).
So $$ \alpha =xy + yz + xz \le 7/27 + 2/27$$
In order to finish the proof we must have
$$ 1/27 \le xyz$$ but instead we have $ xyz \le 1/27$. This is the tricky part..
This problem is from IMO 1984:there is a solution in this link https://mks.mff.cuni.cz/kalva/imo/isoln/isoln841.html that manipulates $xy+yz+xz-2xy$ into something with $(1-2x)(1-2z)(1-2y)$ and then use AM-GM. This only proves for the case $x,y,z < 1/2$.
How to finish the proof?
As mentioned in the solution you have linked at the end,
$$yz+zx+xy-2xyz=\frac14(1 - 2x)(1 - 2y)(1 - 2z) + \frac14$$
Part 1:
If $x,y$ and $z$ are all less than $\frac12$, we get by AM-GM that $(1-2x)(1-2y)(1-2z)\leq \left(\frac{3-2(x+y+z)}{3}\right)^3=\frac1{27}$ and thus
$$yz+zx+xy-2xyz\leq \frac{7}{27}$$
In the case where one of $x,y$ or $z$ is greater than $\frac12$ (note that either $0$ or exactly $1$ of $x,y$ and $z$ is greater than $\frac12$), the term $(1-2x)(1-2y)(1-2z)<0$ so $$yz+zx+xy-2xyz=\frac14(1 - 2x)(1 - 2y)(1 - 2z) + \frac14<\frac14<\frac{7}{27}$$ and the inequality holds true.
Part 2:
We must prove that $yz+zx+xy-2yz\geq0$
Again, we have that $$yz+zx+xy-2xyz=\frac14(1 - 2x)(1 - 2y)(1 - 2z) + \frac14$$
As $x,y,z<1$, $|1-2x|\leq1$ and $|(1-2x)(1-2y)(1-2z)|\leq1$.
This gives that $-1\leq (1-2x)(1-2y)(1-2z)\leq 1$.
Thus, $$yz+zx+xy-2xyz=\frac14(1 - 2x)(1 - 2y)(1 - 2z) + \frac14 \geq \frac{-1}{4}+\frac14=0$$
and the proof is done.
The left inequality is satisfied for $(x,y,z)=(1,0,0)$ and the right inequality is satisfied for $(x,y,z)=(\frac13,\frac13,\frac13)$