I'm looking at these previous threads
Does there exist a continuous function from [0,1] to R that has uncountably many local maxima?
Countability of local maxima on continuous real-valued functions
where several insightful answers have been posted regarding the countability of strict local maxima of functions $f: \mathbb{R} \to \mathbb{R}$.
Now if we let $n \ge 1,$ and instead consider the functions $f: \mathbb{R}^n \to \mathbb{R}$, $x\mapsto f(x)=:y$ it seems to me that the set of strict local maxima (the maximum points $x$'s, not the maximum values $y$'s) of $f$ will still be countable, and the arguments will generalize easily into this $f$ as well.
So just making sure if it's true: are the set of strict local maximum points (not values) of a continuous function $f:\mathbb{R} \to \mathbb{R}$ countable?
Also, does the function $f$ have to be continuous? I don't think it's necessary?
Yes, the statement does hold for functions $f : \mathbb{R}^n \to \mathbb{R}$. Indeed, we need not even assume $f$ is continuous. Here's a generalisation of an answer given by Jonas Meyer in the second question that you linked.
First, set up notation and definitions. Let $X \subseteq \mathbb{R}^n$ be open, and $f : X \to \mathbb{R}$ an arbitrary function (not necessarily continuous). We say $x \in X$ is a strict local maximiser if there is some open neighborhood $x \in U \subseteq X$ such that $f(x) > f(y)$ for all $y \in U \backslash \{ x \}$. For $\delta > 0$, say $x \in X$ is a strict $\delta$-local maximiser if the same holds for $U = D(x, \delta)$ (the open ball around $x$ of radius $\delta$). Let $M \subseteq X$ be the set of strict local maximisers, and $M_\delta \subseteq X$ the set of strict local $\delta$-local maximisers.
We want to prove $M$ is countable. Convince yourself of the following facts:
But each strict $\delta$-local maximiser (indeed each point in $\mathbb{R}^n$) is in some open $\delta/2$-ball centred at a rational point. There are only countably many such open balls, and each one has at most one strict $\delta$-local maximiser. It follows that there are only countably many strict $\delta$-local maximisers.