Q.
Let $f : R \rightarrow R$ and $g : R \rightarrow R$ be defined as
$f ( x )=\begin{cases} x + a , & x <0 \\ \mid x -1 l , & 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 (gof) $( x )$ is continuous for all $x \in R$, then $a + b$ is equal to ________.
Solution: