Given $$f(x) = \begin{cases} \displaystyle 2ax^2\sin \frac{1}{x^2}+b\arctan(e^{-1/x}); & \text{if }x < 0 \\ 2a+1; & \text{if }x = 0 \\ \displaystyle \frac{\sin(ax)}{x}; & \text{if }x > 0 \end{cases}$$
What are the values of $a$ and $b$ which ensure that $f(x)$ is continuous on $\mathbb{R}$?
I was able to find out $a$ to be $-1$. However, I'm having a hard time finding the limit as $x$ approaches $0$ from the left side to be able to find $b$.
We can show that \begin{align} \lim_{x\to 0} x^2\sin \frac{1}{x^2}=0,\tag 1\\ \lim_{x\to 0^-} \arctan\left(e^{-1/x}\right)=\frac{\pi}{2}.\tag 2 \end{align} Showing $(1)$: Note that $|\sin x|\le 1$, then $\left|x^2\sin\frac{1}{x^2}\right|\le x^2$, and $\lim_{x\to 0}x^2=0$. Thus, by the squeeze theorem, we are done.
Showing $(2)$: We know that $\lim_{x\to \infty}\arctan x = \frac{\pi}{2}$, $\lim_{x\to \infty}e^x = \infty$, and $\lim_{x\to 0^-}\left(-\frac{1}{x}\right)=\infty$. Thus $\lim_{x\to 0^-} e^{-1/x}=\infty$ and so we are done.
By Combining $(1)$ and $(2)$, we can find $b$.