Answer
For $f(x)$ to be continuous at every $x$, $a=-2$ or $a=3$.
Work Step by Step
$f(x)=a^2x-2a$ for $x\ge2$ and $f(x)=12$ for $x\lt2$
For $f(x)$ to be continuous at every $x$, $f(x)$ must be continuous at every point on $(-\infty,\infty)$
We would examine 3 intervals:
- For all $x\in(-\infty,2)$, $f(x)=12$, and $$\lim_{x\to c}12=12=f(c)$$
So $f(x)$ is continuous on $(-\infty,2)$
- For all $x\in(2,\infty)$, $f(x)=a^2x-2a$, and $$\lim_{x\to c}a^2x-2a=a^2c-2a=f(c)$$
So $f(x)$ is continuous on $(2,\infty)$
- For $x=2$
Here $f(x)=a^2x-2a$, so $f(2)=a^2\times2-2a=2a^2-2a$.
However, as $x\to2^-$, $f(x)=12$, so $$\lim_{x\to2^-}f(x)=\lim_{x\to2^-}12=12$$
At the same time, as $x\to2^+$, $f(x)=a^2x-2a$, so $$\lim_{x\to2^+}f(x)=\lim_{x\to2^+}(a^2x-2a)=2a^2-2a=f(2)$$
For $f(x)$ to be continuous at $x=2$, $\lim_{x\to2}f(x)$ must exist, which requires that $$\lim_{x\to2^+}f(x)=\lim_{x\to2^-}f(x)$$ $$2a^2-2a=12$$ $$a^2-a-6=0$$ $$(a+2)(a-3)=0$$ $$a=-2\hspace{1cm}\text{or}\hspace{1cm}a=3$$
Since $\lim_{x\to2^+}f(x)=f(2)$ as shown above, $\lim_{x\to2}f(x)=f(2)$ is already satisfied.
Therefore, for $f(x)$ to be continuous at every $x$, $a=-2$ or $a=3$.