I have only a partial theoretical answer, plus another numeric simulation.
As pointed out in a comment to Ian's answer, the solution does not depend on the distribution of the data (as long as it is continuous), so I'm simply using uniformly distributed data on [0, 1].
First, I can confirm that in simulations the expected frequency of local extrema appears to not depend on the length $n$ of sequences, and appears to be exactly 2/3. Here is Matlab code to demonstrate this:
N = 1e6; % number of realizations
n = 100; % length of sequence
ext = diff(sign(diff(rand(n, N)))) ~= 0; % extrema
mean(mean(ext)) % relative frequency across points, estimated expectancy across realizations
First, why exactly 2/3? As the original poster pointed out, the answer of course depends on the probability of occurrences of different orderings, for simplicity for $n = 3$. There are six such orderings: (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1). Because the underlying three random variables are independent and identically distributed, any permutation of the three does not change their joint distribution. The probability distribution across orderings therefore has to be invariant under these permutations. This means this distribution must be uniform, and we therefore have a probability of 1/6 for each ordering.
Since four of the orderings lead to a local extremum, namely those with a 1 or a 3 in the middle position, we have a probability of 4/6 = 2/3 for a local extremum.
As pointed out by Ian, the same probability does not necessarily apply to the situation with $n > 3$. If there is a local maximum at one point, there cannot be a local maximum at each of the neighboring points, i.e. we have a negative local correlation w.r.t. the occurrence of a local maximum. It is however possible that there is a local minimum at the next position. I do not see a way to sort out these correlations theoretically, but I looked at them in the simulated data:
R = corr(ext');
The correlation matrix looks like this:
It appears that the autocorrelation is stationary. Averaging across diagonals we can extract the autocorrelation function
lags = -(n - 3) : n - 3;
r = nan(size(lags));
for k = 1 : numel(lags)
r(k) = mean(diag(R, lags(k)));
with this result:
According to this we do have a small negative autocorrelation (-0.125) at lag 1, but an even smaller positive autocorrelation (0.025) at lag 2. Beyond that, correlations are smaller than $\pm$0.001. So my only guess is that the negative autocorrelation at lag 1 is somehow perfectly counterbalanced by the positive autocorrelation at lag 2 so that the average probability of occurrence of a local extremum stays at 2/3.
Generalization of the order-statistics approach: Just as we enumerated the possible orderings for $n = 3$ above, we can do so also for larger $n$ computationally, and then determine the probability of a local extremum under the assumption (following the same argument as above) that all orderings are equally possible. Here is an implementation in Matlab which uses the Symbolic Math Toolbox to perform exact arithmetic on rational numbers:
for n = 3 : 10
uo = perms(1 : n);
ext = diff(sign(diff(uo'))) ~= 0;
ratio = sprintf('%d / %d', sum(sum(ext)), numel(ext));
fprintf('%d : %s = %s\n', n, ratio, char(sym(ratio)))
The result is
3 : 4 / 6 = 2/3
4 : 32 / 48 = 2/3
5 : 240 / 360 = 2/3
6 : 1920 / 2880 = 2/3
7 : 16800 / 25200 = 2/3
8 : 161280 / 241920 = 2/3
9 : 1693440 / 2540160 = 2/3
10 : 19353600 / 29030400 = 2/3
The first number in the ratios is the number of local extrema, across all $n - 2$ positions and all $n!$ possible orderings, the second is the number of possible local extrema, $(n - 2) ~ n!$.
So now we have the computational but exact proof that the probability is exactly 2/3 for $n$ up to 10. Beyond that, the number of possible orderings becomes so large that it takes very long to evaluate.
I have the feeling this could lead to a proof by induction for arbitrary $n$, but do not know yet how to do so.