Here's what I have done:

$\displaystyle as~x \rightarrow 0^+$ $\displaystyle fe(x) \rightarrow 2$

$\displaystyle \therefore$ for the function to be continuous at $\displaystyle x = 0$, $\displaystyle a$ must = $\displaystyle (0)^3 + 2$

$\displaystyle =2$

$\displaystyle as~x \rightarrow \left(\frac{1}{\pi}\right)^+$ $\displaystyle (bx^2 +2) \rightarrow b\left(\frac{1}{\pi}\right)^2+2$

$\displaystyle \therefore$ for the function to be continuous at $\displaystyle x = \frac{1}{\pi}$, $\displaystyle b$ must = $\displaystyle \frac{\left(\frac{1}{\pi}\right)^2 cos(\pi)}{\left(\frac{1}{\pi}\right)^2}$

$\displaystyle = cos(\pi)$