I believe the answer is contained in the links provided in my comment above, but I will provide the argument here. Even if the function $f$ is not continuous, the mere definition of strict maximum (my understanding is that what is meant is a strict local maximum) involves neighborhoods, and that allows for a proof that there are at most $\#\mathbb N$ (i.e. at most countably many) strict local maxima.
Suppose that $f:\mathbb R\to\mathbb R$ had uncountably many strict local maxima. Let $X=\{x\in\mathbb R:f$ has a strict local maximum at $x\}$. In other words, $x\in X$ if and only if there is some $\varepsilon_x>0$ such that
$f(x)>f(y)$ whenever $y\in(x-\varepsilon_x,x+\varepsilon_x)\setminus\{x\}$.
Equivalently, $x\in X$ if and only if there is some positive integer $n_x$ such that $f(x)>f(y)$ whenever $y\in(x-\frac1{n_x},x+\frac1{n_x})\setminus\{x\}$. For each $x\in X$ fix $n_x$ as above. Let $X_n=\{x\in X:n_x=n\}$.
Then $X=\bigcup_{n\in\mathbb N} X_n$, hence if $X$ were uncountable there is $n$ such that $X_n$ is uncountable.
There must be a point $z\in X_n$ such that every neighborhood of $z$ intersects $X_n$ in uncountably many points. (Indeed if no such $z$ exists, then every $x\in X_n$ would have a countable relative neighborhood, and using that every subspace of $\mathbb R$ has a countable basis, and is hence Lindelof, it would follow that $X_n$ were countable.) In particular we could take distinct $x,y\in X_n$, each distance less than $\frac1{2n}$ to $z$, and hence distance from $x$ to $y$ is less than $\frac1n$. Since both $x$ and $y$ belong to $X_n$ it follows that $f(x)>f(y)$ and $f(y)>f(x)$, a contradiction, which shows that $X$ must be countable. (This could be edited further: I didn't really use that $z\in X_n$, so it could have been enough to pick $z\in\mathbb R$ which is an accumulation point of $X_n$. But I used that these local maxima are strict, otherwise a constant function would provide a counterexample.)