Find values of $a$ and $b$ that make the function continuous everywhere. I need some help with this question:

Find the values of $a$ and $b$ that make $f$ continuous everywhere.
$$f(x)=\begin{cases}
x^2 − 4/x-2, &\text{if }x < 2\\
ax^2-bx+1, &\text{if } 2 ≤ x ≤ 3\\
4x - a + b, &\text{if } x ≥ 3\end{cases}$$

I started by writing two expressions for $a$ and $b$ based upon the left and right limits of each piece's endpoints. But I ended up with $a=3/2$ and $b=2/3$. Where did I go wrong?
 A: I've seen this problem before and it looks like this may be the function you are trying to make continuous here:
$f(x) = \begin{cases} \frac{x^2-4}{x-2} & \mbox{if } x<2 \\ ax^2-bx+1 & \mbox{if } 2\leq x<3 \\ 4x-a+b & \mbox{if } x\geq 3 \end{cases}$
To make sure $f$ is continuous at $x=2$ you want to use the definition of what it means to be continuous by solving $\lim_{x \to 2} f(x) = f(2).$  Since $f$ is different from the left and right side of $x=2$, you need to instead find each one sided limit.
$$\lim_{x \to 2^{-}} f(x) = f(2)$$
$$\lim_{x \to 2^{+}} f(x) = f(2).$$
First the left sided limit: $$\lim_{x \to 2^{-}} \frac{x^2-4}{x-2} = f(2)$$
$$\lim_{x \to 2^{-}} \frac{(x+2)(x-2)}{x-2} = f(2)$$
$$\lim_{x \to 2^{-}} (x+2) = f(2)$$
$$4=f(2)$$
$$4=a(2)^2-b(2)+1$$
$$4=4a-2b+1$$
$$3=4a-2b$$
If you do this with the right sided limit, you'll see that you end up with $4a-2b+1=4a-2b+1$, which doesn't really give you any useful information.  Now you want to do the same thing to make sure $f$ is continuous at $x=3$
$$\lim_{x \to 3^{-}} f(x) = f(3)$$
$$\lim_{x \to 3^{-}} ax^2-bx+1 = 12-a+b$$
$$a(3)^2-b(3)+1 = 12-a+b$$
$$9a-3b+1 = 12-a+b$$
$$10a-4b=11$$
And in this case, the right sided limit won't contribute anything useful.  Now you just need to solve the following system of equations:
$$3=4a-2b$$
$$10a-4b=11$$
Here's a link to a very detailed work-through of a very similar problem with a bit more explanation of why this works.
https://jakesmathlessons.com/limits/solution-find-the-values-of-a-and-b-that-make-f-continuous-everywhere/
A: If $f$ is continuous then :
$f(2)=\underset{x\rightarrow2}{\lim}f(x)=2^2-\frac{4}2-2=a(2^2)-b(2)+1$
Therefore $4a-2b+1=4-2-2=0$ hence $4a-2b+1=0$.
Same reasoning around $x=3$ : 
$a(3^2)-b(3)+1=4(3)-a+b$ (ie) $9a+3b+1=12-a+b$ therefore $10a-4b=11$
You just need to solve $\begin{cases}4a-2b=-1\\10a-4b=11\end{cases}$ to find $a$ and $b$.
A: For continuity at 2, we need $\lim_{x\to2^{+}}f(x)=f(2)$ and $\lim_{x\to2^{-}}f(x)=f(2)$, so $4a-2b+1=4a-2b+1$ and $4-2-2=4a-2b+1$, so $4a-2b=-1$.
For continuity at 3, we need $\lim_{x\to3^{+}}f(x)=f(3)$ and $\lim_{x\to3^{-}}f(x)=f(3)$, so $12-a+b=9a-3b+1$ and $9a-3b+1=9a-3b+1$, so $10a-4b=11$.
Now solve these two equations for a and b.
(I am assuming the last part of the definition should say for $x>3$.)
