I am defining the set valued inverse as follows:
$$f^{-1}(C) = \{x \in \mathbb{R}|\ f(x) \in C\}$$
Then the set for the function would be:
$$f(\mathbb{R})=\{f(x) \in C|\ x \in \mathbb{R}\}$$
I think to show that $f(x)=x^2$ is convexity preserving
I would need to pick $f(x_1)\in f(\mathbb{R})$ and $f(x_2) \in f(\mathbb{R})$ (which implies $x_1 \in \mathbb{R}$ and $x_2 \in \mathbb{R}$) then show that:
$$\theta f(x_1)+(1-\theta)f(x_2) \in f(\mathbb{R}),\ \ \ \ \theta\in[0,1]$$
So then I need to show,
$$\theta x_1^2+(1-\theta)x_2^2 \in f(\mathbb{R})$$
But I am not sure how to proceed since I can't put it in the form $(\theta x_1 + (1-\theta) x_2)^2$, which I would then be able to show that since $x_1 \in \mathbb{R}$ and $x_2 \in \mathbb{R}$ then $\theta x_1 + (1-\theta) x_2 \in \mathbb{R}$ which implies $(\theta x_1 + (1-\theta) x_2)^2 \in f(\mathbb{R})$.
I am aware of the definition of convex function i.e.:
$$f(\theta x+(1-\theta)y) \le \theta f(x) +(1-\theta)f(y)$$
But since we are dealing with sets instead of functions it seems to be a little different. How would $(\theta x_1 + (1-\theta) x_2)^2 \le \theta x_1^2+(1-\theta)x_2^2\ $ imply that $\theta x_1^2 + (1-\theta) x_2^2 \in f(\mathbb{R})$?
So how would I show $f(x)=x^2$ preserves convexity and it's set valued inverse does not?
Continuity is not preserved by the inverse image, since $\{1\}$ is convex yet $f^{-1}(\{1\})=\{1,-1\}$ is nonconvex.
To show that $f$ preserves convexity, let $y_1,y_2\in f(C)$, and let $\alpha\in(0,1)$. Therefore $(\exists x_1,x_2\in C)$ such that $f(x_1)=y_1$ and $f(x_2)=y_2$. Without loss of generality, $y_1\leq y_2$. Since $f$ is continuous on $\mathbb{R}$, the intermediate value theorem guarantees that \begin{equation} (\exists \xi\in\mathbb{R})\quad \xi^2=f(\xi)=\alpha y_1+(1-\alpha)y_2=\alpha f(x_1)+(1-\alpha)f(x_2). \end{equation} Now it only remains to show that $\xi$ also resides in $C$. Hint: since $\xi^2\in[x_1^2,x_2^2]$, either $\xi\in\left[-\sqrt{x_2^2},-\sqrt{x_1^2}\right]$ or $\xi\in\left[\sqrt{x_1^2},\sqrt{x_2^2}\right]$. Case analysis on the signs of $x_1$ and $x_2$ should yield the rest :)