Choose constants a and b so that the function is differentiable for all x? 
My thought is that the two functions must have the same set of solutions? 
Because this is true: 

That didn't really get me anywhere, where should I start? A hint please? 
 A: Hint: $g(1+0)=g(1-0)$ and $g'(1+0)=g'(1-0)$.
A: In particular, you must choose $a,b$ such that $$g'(1):=\lim_{x\to 1}\frac{g(x)-g(1)}{x-1}$$ exists, meaning we need for $$\lim_{x\to 1^-}\frac{g(x)-g(1)}{x-1}=\lim_{x\to 1^+}\frac{g(x)-g(1)}{x-1},$$ so we need $$\lim_{x\to 1^-}\frac{(x^2-bx)-(1-b)}{x-1}=\lim_{x\to 1^+}\frac{(ax^2+1)-(1-b)}{x-1},$$ or rather, since $(x-1)(x+1-b)=(x^2-bx)-(1-b),$ we need $$2-b=\lim_{x\to 1^+}\frac{ax^2+b}{x-1}.\tag{$\star$}$$
Note that $$\frac{ax^2+b}{x-1}=\frac{a(x^2-1)+a+b}{x-1}=a(x+1)+\frac{a+b}{x-1},$$ so in order for the limit on the right side of $(\star)$ to exist, we must have $a=-b$, whence $(\star)$ yields $2-b=-2b$, so $b=-2$ and $a=2$.

If you're instead familiar with the definition $$g'(1)=\lim_{h\to 0}\frac{g(1+h)-g(1)}{h},$$ then we need $$\lim_{h\to 0^-}\frac{g(1+h)-g(1)}{h}=\lim_{h\to 0^+}\frac{g(1+h)-g(1)}{h}\\\lim_{h\to 0^-}\frac{(1+h)^2-b(1+h)-(1-b)}{h}=\lim_{h\to 0^+}\frac{a(1+h)^2+1-(1-b)}{h}\\\lim_{h\to 0^-}\frac{2h+h^2-bh}{h}=\lim_{h\to 0^+}\frac{a+b+2ah+ah^2}{h}\\\lim_{h\to 0^-}(2-b+h)=\lim_{h\to 0^+}\left(2a+ah+\frac{a+b}h\right)\\2-b=2a+\lim_{h\to 0^+}\frac{a+b}h.$$ Once again, we need $a=-b,$ from which the above conclusions follow.
A: Perhaps we could also state the problem in layman terms... The two relations in the piece-wise function are polynomials and thus everywhere differentiable... the only issue could be at the domain restriction - you have to ensure the functions touch and there is no kink there... so for function value, set the two relations equal and for derivative value, set the derivative of each relation equal. Evaluate at the domain restriction and solve this somewhat simple system of equations.
