In the book titled: Discrete Mathematical Structures, by Tremblay; it is stated as Q.#1 in Ex. 2-4.3:
Let $f:\mathbb{R}\to \mathbb{R}$ and $g:\mathbb{R}\to \mathbb{R}$, where $\mathbb{R}$ is the set of real numbers. Find $f\circ g$ and $g\circ f$, where $f(x)= x^2 -2$ and $g(x) = x+4$. State whether these functions are injective, surjective, or bijective.
$f\circ g = x^2 +8x +14$,
$g\circ f=x^2 +2$
By my earlier post, have gathered that as an even order function will not be having a unique x-value for each y-value so none is injective.
But, am still not sure about disproving surjectivity. My approach is not based on calculus (that am still unable to understand, as stated on mse here); but is based on disproof by taking cases where failure occurs.
The minimum value taken up by $f\circ g = x^2 +8x +14$ is $14$.
Similarly, the minimum value taken up by $g\circ f = x^2 +2$ is $2$.
Hence, the entire range is not mapped.
Have a further request to make me understand by the calculus approach.
Update In face of comment by @Arthur, the correct minimum value for $f\circ g = x^2 +8x +14$ is given for $x=-4$, i.e. $-2$.
This is found by simply differentiating wrt $x$ & equating to $0$ to find the minima point.
Consider a continous function $h$ on $\mathbb{R}$, satisfying $\lim_{x \to \infty} h(x) = \infty$ and $\lim_{x \to -\infty}h(x) = \infty$.
then there exists an $M>0$, such that $|x| > M$, we have $f(x) > 1$.
Also, on $[-M, M]$ which is a compact set, the continous function attains a minimum value $m$.
Hence, it is impossible to attain $\min\{m,1\}-1$, hence it can't be surjective.
If a function has attains a global optimum, it can't be surjective as we can't have values that perform better than the global optimum.
Update:
For example, given any quadratic equation with leading positive coefficient, then it satisfies the condition. I know such $M$exists, but we are not interested in its exact value, I just know it exists. For the example of $f(x)=x^2-2$, I can pick $M$ to be $2$.
Then if you look at any values $x \in (-\infty, -2) \cup (2, \infty)$, we know that $f(x) > 1$.
Now, let's look at $[-2,2]$, we found a minimal value, which is $(0,-2)$.
We can't attain value like $-3$ because we know that on the interval $[-2,2]$, the minimal value is $-2$ and outside $[-2,2]$, their values are bigger than $1$.