Limit inequality Assume that there exists and continuous function $f: ]1, 2[ \rightarrow \mathbb{R}$ which satisfies the conditions:
$$\lim_{x \to 1^+} f(x) = -\infty \text{ and }  \lim_{x \to 2^-} f(x) = -\infty$$
Show that there exists a $c \in ]1, 2[$, for which all $x \in ]1, 2[$ holds that $f(x) \leq f(c)$
What's the correct approach here?
 A: Let $A=f\left(\frac{3}{2}\right)$
As $\lim_{x\rightarrow 1+} f(x)=-\infty$, there exists $\alpha \in \left] 0, \frac14 \right[$ such that for all $x\in \left] 1, 1+\alpha \right[$, $f(x)<A$
As $\lim_{x\rightarrow 2-} f(x)=-\infty$, there exists $\beta \in \left] 0, \frac14 \right[$ such that for all $x\in \left] 2-\beta, 2 \right[$, $f(x)<A$
We have $1+\alpha < 2-\beta$ (because $\alpha<1/4$ and $\beta<1/4$)
We can consider $[1+\alpha, 2-\beta]$ which is included in $]1,2[$ and as $f$ is continuous on $]1,2[$, it is continuous on $[1+\alpha, 2-\beta]$.
Hence there exits $c\in [1+\alpha, 2-\beta]$ such that for all $x\in [1+\alpha, 2-\beta]$, $f(x) \leq f(c)$.
Moreover $A=f\left(\frac{3}{2}\right)\leq f(c)$
This implies that 
for all $x\in]1,2[, f(x)\leq f(c)$
A: Consider $g(x) = \exp(f(x))$. Then $g$ is continuous on $]1, 2[$ and the limits are both zero. (The definition of $f(x) \rightarrow -\infty$ as $x \rightarrow 2^-$ is that for all $M > 0$ there exists $\delta > 0$ such that $f(x) < -M$ whenever $2-\delta < x < 2$. If $\epsilon > 0$ then take $M = -\log(\epsilon)$, so $f(x) < -M = \log(\epsilon)$ implies $g(x) < \epsilon$.)
Extend $g$ to $\tilde{g}: [1, 2] \rightarrow \mathbb{R}$ by continuity, with $\tilde{g}(1) = \tilde{g}(2) = 0$. Note $\tilde{g} > 0$ in $]1, 2[$ since $\exp > 0$ for all $x \in \mathbb{R}$. Since $[1, 2]$ is compact, $\tilde{g}$ attains a maximum in $[1, 2]$, in fact a positive maximum $]1, 2[$ since $\tilde{g}(1) = \tilde{g}(2) = 0$, and therefore $g$ and $f$ also have a maximum (in $]1, 2[$).  
Note this is essentially the same style of argument as the previous answer; by continuity the maximum will occur away from the endpoints. 
