Step 1 :The function is continuous if the limit from the left and right at the points of discontinuity are equal. The points of discontinuity are at x=3 and x=5. We need to find the values of a and b such that the function is continuous at these points.
Step 2 :At x=3, the limit from the left is given by the first piece of the function and the limit from the right is given by the second piece of the function. We need to find a and b such that these two limits are equal.
Step 3 :At x=5, the limit from the left is given by the second piece of the function and the limit from the right is given by the third piece of the function. We need to find a and b such that these two limits are equal.
Step 4 :By calculating the limits, we get the following equations: \(8 = 3a + b\) and \(5a + b = 0\).
Step 5 :Solving these equations, we find that \(a = -4\) and \(b = 20\).
Step 6 :Final Answer: The function is continuous on the whole real line \(-\infty, \infty\) for \(a = -4\) and \(b = 20\). So, the final answer is \(\boxed{a = -4, b = 20}\).