Given a set $S$, a function $M: S\times S \rightarrow S$ is a mean if it satisfies the properties:
$M(a,a)=a\qquad$ (identity)
$M(a,b)=M(b,a)\qquad$ (commutativity).
and possibly
$M(M(a,b),M(a,c))=M(a,M(b,c))\qquad$ (weak associativity)
$M(M(a,b),M(c,d))=M(M(a,c),M(b,d))\qquad$ (strong associativity)
$a\ne b \implies a\ne M(a,b)\ne b\qquad$ (sharpness).
When $S$ is an abelian groupoid or an ordered set or a topological space, $M$ can have additional specific requirements, such as:
$M(ac,bc)=cM(a,b)\qquad$ (homogeneousness - see UPDATE)
$a < b \implies a\le M(a,b) \le b\qquad$ (order preservation - see UPDATE)
continuity.
This counteraxample is wrong. After fixing my gawk code I found that there (3) always implies (4) in a set of 5. Thanks to Eric Wofsey for noticing.
In general (3) does not imply (4) as can be seen in this example for $S=\{a,b,c,d,e\}$:
$$ \begin{array}{c|ccccc} M & a & b & c & d & e\\ \hline a & a & a & a & a & a\\ b & a & b & d & c & a\\ c & a & d & c & b & a\\ d & a & c & b & d & e\\ e & a & a & a & e & e\\ \end{array}$$
where $M(M(b,c),M(d,e)) \ne M(M(b,d),M(c,e))$.
Here are some of the questions that come to mind.
Q1. Is there a finite example where (3) and (5) hold, but not (4)? I know that $S$ will need to have at least 6 elements.
Q2. Does $M$ in the above example naturally extend to a mean in $\mathbb{R}[a,b,c,d,e]$ where both (3) and (6) hold?
Another example: if $A$ and $G$ are the arithmetic and geometric means on $\mathbb{R}^+$, it's easy to check that the mean function $M(x,y)=G(A(x,y),G(x,y))$ satisfies all the properties except (3) and (4).
Q3. Assuming all of the above properties except (4) hold for $M$ on $\mathbb{R}^+$, does (4) follow?
Q4. My starting point leading to this post: if all the above properties, including (4), hold for $M$ on $\mathbb{R}^+$, does it follow that $M$ is equivalent to the arithmetic mean, in the sense that $M(x,y)=f^{-1}\big(\frac{f(x)+f(y)}{2}\big)$ for some continous strictly monotonic function $f: \mathbb{R}^+ \to \mathbb{R}$?
I welcome suggestions for improvements to this post and references to relevant work.
UPDATE. It turns out that neither (6) nor (7) are needed anywhere, at least for the questions explored in this thread.
This is superseded by Eric Wofsey's answer
UPDATE. If $M(x,y):=f^{-1}\big(\frac{f(x)+f(y)}{2}\big)$ then notice that we can translate and rescale $f$ and the equality still holds. Now we try to build $f$. To start, we are allowed to assume $f(1/2)=1/2$ and $f(2)=2$. The graph of $f$ can then be constructed in the following way, as per Eric Wofsey's comment below: for each 2 consecutive known points $(x_1, y_1=f(x_1))$ and $(x_2, y_2=f(x_2))$ build an intermediate point $\big(M_f(x_1,x_2), \frac{y_1+y_2}{2}\big)$. By density of the dyadics in $\mathbb{R}$ and properties (5), (7) and (8) of $M$, this procedure defines $f$ in the interval $I=[1/2,2]$. Associativity (hopefully in its weak form) should then be used to prove that the same procedure applied to 2 overlapping subintervals of $I$ yields identical results on the intersection. Finally, if that worked, conclude the proof by defining a second $f$ on $[1/4,4]$. This second $f$ can be translated and rescaled to satisfy $f(1/2)=1/2, f(2)=2$ and must then match the original $f$ in $[1/2,2]$. Repeating this step will extend $f$ to $\mathbb{R}^+$.