Find $a$ that makes $f$ continuous and doesn't have extrema Find $a$ that makes $f$ continuous and doesn't have extrema:
$f(x)=\begin{cases} 
      ax^2 & x\leq 1 \\
      a^2x-2 & x>1 
   \end{cases}$
Here's what I've been doing:
$\lim \limits_{x \to 1^-} ax^2=a$ and $\lim \limits_{x \to 1^+}a^2x-2=a^2-2$
Then I found the roots for $a^2-a-2=0$, which are $-1$ and $2$.
Ok, so here's my problem, if you plug in both values for $a$, $f(x)$ is continous for both values, so now I have to find which one makes the function not have extrema... (Clearly looking at the graphic, the answer is $-1$, I just don't know how to prove it by "algebraic means")
What I tried (I don't know if it's correct), is to find the limit as $x \rightarrow \infty$ for both cases:
When $a=-1$
$\lim \limits_{x \to \infty} -x^2=-\infty$ and $\lim \limits_{x \to \infty} x-2=\infty$ By this I just assumed that $f(x)$ doesn't have extrema.
When $a=2$
$\lim \limits_{x \to \infty} 2x^2=\infty$ and $\lim \limits_{x \to \infty} 4x-2=\infty$ ??? 
Btw, I can't use derivatives to find the extrema...
Thank you :-)
 A: Your solution for the second part somewhat works. To show the case when $a=-1$ has no global extrema, you can do what you did: you showed that the function is neither bounded above nor below. For the $a=2$ case, you want to show that $f$ has a global extrema by considering $x=0$ and show $f(x)\geq f(0)$ for all $x$. I will argue this below and give an alternative answer for $a=-1$ as well. Although, I think graphing is the simplest way for this particular problem.

Considering only global extrema, you are correct that $a=-1$ gives the result, but any other $a$ value does not. I will provide some algebraic reasoning (no derivatives) for one to make a solution. You've narrowed our choices down to $a=-1,2$ by requiring continuity, and you did this just as I would. So we consider the global extrema condition on each of these two $a$ values. I'll call $f_1:(-\infty, 1]\to \Bbb R$ with $f_1(x):=ax^2$, and $f_2:(1,\infty)\to\Bbb R$ with $f_2(x):=a^2x-2$, so that $f(x)=f_1(x)$ for $x\leq 1$ and $f(x)=f_2(x)$ for $x>1$.
Suppose $a=2$. Then $f_1$ and $f_2$ both have positive leading coefficients. Since $f_1$ is a quadratic with positive leading coefficient it must have a global minimum (in this case it is at $x=0$, which is easy to see). Since $f_2$ is a linear function with positive leading coefficient, and it is only defined for $x>1$, it must satisfy $f_2(x)\geq f_2(1)=f(1)$. Since $f(1)>f(0)$, we conclude that $f(0)$ is the minimum value of $f$, so $x=0$ is a global minimum, and thus $f$ has a global extremum.
Suppose $a=-1$. Then $f_1$ has a negative leading coefficient, so it has a global maximum but no global minimum (indeed, $f_1(x)\to -\infty$ as $x\to -\infty$). Also, $f_2$ is linear with a positive leading coefficient, so it has a lower bound (just as in the $a=2$ case), but has no global maximum (indeed, $f_2(x)\to \infty$ as $x\to\infty$). Hence, $f$ has no global maximum or global minimum, because $f_1$ has no min and $f_2$ has no max.
A: $$\lim \limits_{x \to -\infty} 2x^2=\infty$$
$$\lim \limits_{x \to \infty} 4x-2=\infty$$
also, $f(x)$ is continues thus you can say that $f(x)$ doesn't have global maxima
but it must have a global minimum somewhere in $x \in(-\infty,\infty) $ because $f(x)$ is continues function 
so $a=-1$ is the right choice because in that case, you don't have any global extrema because
$$\lim \limits_{x \to \infty} -x^2=-\infty$$
$$\lim \limits_{x \to \infty} x-2=\infty$$
