The graph of f(x) is shown below, which consists of five line segments.
Let a be the largest negative integer such that the function g(x) = f(x) + ax is invertible. Let $b$ be the smallest positive integer such that the function $h(x) = f(x) + bx$ is invertible. Find $a^2+b^2$.