Let $h(x)$ be a piecewise function in which
$$h(x) = \begin{cases} 1+x &\text{if $x < 0$}\\ ax+b & \text{if $0\le x\le 1$}\\ 4x+2 & \text{if $x > 0$} \end{cases} $$
And also note that $h(x)$ is continuous at $x=0$ and $x=1$.
Given these implications, the following must be true, given what I see:
$$1+x = ax+b \iff x=0 $$
$$ax+b = 4x+2 \iff 0 < x\le1$$
Apparently to solve this, we use the first statement to solve for $b$ with $x=0$ and the second statement to solve for $a$ with $x=1$. However, this puzzles me.
I can kind of see how to find $b$ using this logic, since, even though $1 + x \ne h(x)$ at $x=0$, it must be equal to $ax+b$ since it's continuous and if it were not true then the function would not be continuous. But then, is $1+x,\ \,\ x < 0 = h(x)$ really a true statement?
Furthermore, with finding $a$, using the second bit, if $a$, $b$, $4$, and $2$ all constants, how can $ax + b = 4x+2$ only conditionally? It would seem clear as day given this equation $a = 4$ and $b = 2$ if this is true for any instant and then, since $a$ and $b$ are constants, the transition to $4x+2$ should be no change in the image of the function at $x > 1$. Retrospectively, it must be because this is true if $ax+b$ and $4x+2$ have the same output from $0<x \le 1$ but do not necessarily need to have the same image for all x. But also, why do I have to use $x=1$ to solve for $a$? Can't I use any real number from $(0,1]$?