Let $f : R \to R$ and $g : R \to R$ be defined as $f(x) = \begin{cases} x + a, & x < 0 \\ |x - 1|, & x \geq 0 \end{cases}$ and $g(x) = \begin{cases} x + 1, & x < 0 \\ (x-1)^2 + b, & x \geq 0 \end{cases}$, where $a$, $b$ are non-negative real numbers. If $g \circ f(x)$ is continuous for all $x \in R$, then $a + b$ is equal to ______.
Numerical-value question: the answer is a number.
Show answer
The answer is 1.
Key from source paper