The differentiation & setting of the derivative to zero yields stationary points. A range-of-x ought to have been specified for this question, as without it it is ill-posed.
To say that the function has a maximum value of ∞ at x=∞ is a scrambling of the meaning of what's going-on, which is that the function increases without limit as x increases without limit, & therefore does not have a maximum value. If a range of x had been given, you would compare the -7 gotten as a local maximum to the value taken by the function at the upper end of the range of x (you need not consider the lower end of the range of x as the function is decreasing without limit in that direction) ... and whichever were the greater would be the answer to the question.
A fussy little point though: but it's important in many kinds of problem: the range would have to be a closed range - ie of the form $$a\leq x\leq b ,$$ often denoted $$x\in[a,b], $$ rather than what is called an open range $$a< x< b ,$$ often denoted $$x\in(a,b) ;$$ as if it were the latter that were specified, you would technically still have the problem of the non-existence of a maximum value of the function if the upper limit of the range were such that it could exceed -7 for x still less than it.