What *really* are the local maxima and local minima In math is the local max and local min just any peak ... point where slope of the function changes from positive to negative or vice-versa... Or are the LOCAL max and min just the highest point of the function and lowest point of a function in a given range? If that were the case wouldn't there be infinite local max and min since you can have infinite ranges? Or inorder for something to be considered a local maxima or minima does slope have to change? (Rather than slope, is it that differentiability has to become non-existant at that point?) 
 A: When one is talking about a local or global maximum of some real-valued function $f$ the domain of reference has to be specified precisely. Many functions are defined by an expression in terms of some input variable $x$ which may take integer, positive, real, complex, or vector values. Only after the exact domain $\Omega$ of admissible $x$ for the problem at hand has been specified (say, the closed unit ball with center $0\in{\mathbb R}^n$) can we start thinking about maxima or minima of $f$.
The function $f:\ \Omega\to{\mathbb R}$ takes a global maximum at the point $\xi\in\Omega$, if $f(\xi)\geq f(x)$ for all $x\in\Omega$. This definition should cause no problems.
The function $f:\ \Omega\to{\mathbb R}$ with $\Omega\subset{\mathbb R}^n$ takes a local maximum at the point $\xi\in\Omega$, if there is a neighborhood $U(\xi)\subset{\mathbb R}^n$ such that $f(\xi)\geq f(x)$ for all $x\in\Omega\cap U(\xi)$. This means that far away from $\xi$ there may still be points $x\in\Omega$ with $f(x)>f(\xi)$. 
The difficulty in this definition consists in the word "local". When the domain $\Omega$ of $f$ is a subset of ${\mathbb R}^n$, for example, then "local" refers to the so-called relative topology of $\Omega$. In this respect consider the following example:
$$f(x):=(x-1)^2\ ,\qquad \Omega:=[0,3]\ .$$
Then there is a unique point $\xi\in\Omega$ where $f$ takes a global maximum, namely the point $\xi=3$. At the point $\xi'=0$ the function $f$ takes a local maximum with respect to $\Omega$, since
$$f(0)\geq f(x)\qquad\forall x\in\ ]{-1},1[\ \cap\Omega\ .$$
A: If you think of a function $f$ of one variable, then a local maximum of $f$ is a point $x^*$ in the domain of $f$ such that there is an open interval $I$ which contains $x^*$ and that $f(x^*) \ge f(x)$ for all $x \in I$ which is in the domain of $f$. 
For domains lying in more general space, we replace the word “interval” in the above with “neighbourhood”.
So a local maximum is indeed a peak, except that it does not have to be “peaked”. If $f(x)=2$ for all $x$ then every $x$ is a local maximum of the function. For the function $f(x)=2x$ defined on $[0,1]$, $x^*=1$ is a local maximum.
