This is from a recently closed question. I do not think the accepted answer is rigorous because it did not address the cases when the discriminant of the two quadratics is negative, even though the final answer was correct.
My solution relies heavily on plotting several inequalities. I wonder if there is an alternative yet clean way of doing it without the plots. Another idea is whether it is helpful by replacing $x$ with $y+1$ so that $-1 \le y \le 1$ may simplify things a little bit.
My solution:
Denote $f(x)=x^2+ax+b$. It achieves its minimum at $x=-\frac a2$ and $f(-\frac a2)=b-\frac{a^2}{4}$.
First we must have $|f(0)| \le \frac 12 \text{ and } |f(2)| \le \frac 12$, or equivalently $$|b| \le \frac 12 \tag1$$ $$|4+2a+b|\le \frac 12 \tag2$$
From the plots on the $a,b$-plane, we see that $(a,b)$ must reside in the parallelogram $BCDE$ and that $-\frac a2 \in [\frac{1.5}{2}, \frac{2.5}{2}] \subset [0,2]$, therefore we must also have
$$|f(-\frac a2)|=|b-\frac{a^2}{4}|\le \frac 12 \tag 3$$
After we add $(3)$ to the plots we found the only intersection of $(1), (2), (3)$ is at the point $C$ where $a=-2, b=\frac 12$. And indeed, when $0 \le x \le 2$, we have $|f(x)|=\left|(x-1)^2-\frac 12\right| \le \frac 12$.

The polynomial $x^2 - 2 x + \frac{1}{2}$ takes values $\frac{1}{2}$, $-\frac{1}{2}$, $\frac{1}{2}$ at $0$, $1$, $2$. We conclude that the linear function $(x^2-2x+ \frac{1}{2}) - (x^2+ a x + b)$ takes values $\ge 0$, $\le 0$, $\ge 0$ at $0$, $1$, $2$, so it must be the $0$ function. We get $a=-2$, $b=\frac{1}{2}$.