Finding the value of constants that make a function continuous $$  f(x) =
\begin{cases}
x^{-1}  & \text{for $x<-1$} \\
ax+b & \text{for $-1\le x\le \frac 12$} \\
x^{-1}  & \text{for $x>\frac 12$} \\
\end{cases}$$
I don't understand how I am supposed to find the value of the constants. It seems as if there is not enough information to determine that. I did a problem in which it had only one constant, $c$ and I was easily able to determine the value of it by setting both pieces of the function equal to each other and evaluating them at the $x$ values. How would I go about doing this here?
 A: $\lim_{x\to-1^-}f(x)=-1$, So we need $ax+b=-1$ for $x=-1$.  Hence $b-a=-1$.  On the other hand, $\lim_{x\to1/2^+}f(x)=2$. Hence $\frac12a+b=2$.
A: To make sure $f$ is continuous at $x=-1$ you want to use the definition of what it means to be continuous by solving $\lim_{x \to -1} f(x) = f(-1).$  Since $f$ is different from the left and right side of $x=-1$, you need to instead find each one sided limit.
$$\lim_{x \to -1^{-}} f(x) = f(2)$$
$$\lim_{x \to -1^{+}} f(x) = f(2).$$
First the left sided limit: $$\lim_{x \to -1^{-}} x^{-1} = f(-1)$$
$$\lim_{x \to -1^{-}} \frac{1}{x} = a(-1)+b$$
$$-1=-a+b$$
If you do this with the right sided limit, you'll see that you end up with $-a+b=-a+b$, 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=\frac{1}{2}$.  First the right sided limit:
$$\lim_{x \to \frac{1}{2}^{+}} f(x) = f\bigg(\frac{1}{2}\bigg)$$
$$\lim_{x \to \frac{1}{2}^{+}} x^{-1} = a\bigg(\frac{1}{2}\bigg)+b$$
$$2=\frac{1}{2}a+b$$
And in this case, the left sided limit won't contribute anything useful.  Now you just need to solve the following system of equations:
$$-1=-a+b$$
$$2=\frac{1}{2}a+b$$
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/
