You want to find $ax^2 + bx + c$ so that
- $\frac 12$ and $1$ are solutions and
- that $a,b,c$ are all integers.
$(x - \frac 12)(x -(-1))$ will be a quadratic with those roots[*], but it might not have integer coefficients. To get integer coefficients we can multiply it by some constant. ... so what $ax^2 + bx + c$ has $\frac 12$ and $-1$ as roots?
.....
[*] If $x=\frac 12$ then $x-\frac 12= \frac 12 -\frac 12 = 0$ and so $(x-\frac 12)(x-(-1)) =0(x-(-1))= 0$. ANd if $x =-1$ then $(x-(-1)) = 0$ and $(x-\frac 12)(x-(-1)) = (x-\frac 12)\cdot 0 = 0$.
====
If a quadratic has roots $r_1$ and $r_2$ then $r_1, r_2$ are solutions to $(x-r_1)(x-r_2)$ and any quadratic that has those to solutions can be factored to $k(x-r_1)(x-r_1)$ where $k$ is some non-zero constant.
So if $ax^2 + bx + c$ has roots $r_1, r_2$ then $ax^2 + bx + c = k(x-r_1)(x-r_2)$.
SO we need to figure out if $k(x-\frac 12)(x - (-1))=ax^2 + bx + c$ and $a,b,c$ are all integers... what are $a,b$ and $c$.
And ... just do it.
$k(x-\frac 12)(x+1) = k(x^2 -\frac 12x + x - \frac 12)= k(x^2 +\frac 12x -\frac 12)=kx^2 + \frac 12kx -\frac 12k$.
So we need $k, \frac 12k, -\frac 12k$ to be integers.
We can do that if $k=2$.
So $2x^2 +x -1$ will have as solutions $\frac 12$ and $-1$.