To show a maximum exists: first, if f is the zero function, then every point is a maximum. Otherwise, there is some x such that f(x)>0. Now by hypothesis you can find M>0 such that f(y)<f(x) for all y<-M and all y>M. Finally, you know that a continuous function achieves its min/max values on a compact set, so that f restricted to [-M,M] has a maximum, and by construction, [-M,M] contains at least one point where the value of f is greater than at any point outside [-M,M], so in fact it's a global maximum.
For the minimum...it's actually not true as stated, since the zero function is a counterexample. Ruling that out (for instance, by changing the codomain to (0,inf)), suppose there is a minimum (it would be some nonzero value) and derive a contradiction.