<s>[INST] How does this proof that $xyz \le\left (\frac{x+y+z}{3}\right)^3$ work? I have shown that the function $f(x)=x\left(\frac{na-x}{n-1}\right)^{n-1}$, $n \ge 2, a \ > 0$ with domain $0 \le x \le na$ achieves a global maximum at $x=a$. I am then supposed to show, using this function when $n=2$ and $n=3$ that if $x + y + z = 3a$, $x, y, z \ge 0$, then $a^3 \ge xyz$.
I've tried finding $f(xyz), f(x+y+z)$ etc. all to no avail. I have shown that $f(a)=a^n$, but got no further. The solution goes as follows:

By (i) [the results that there is a global maxima at a] with $n = 2$, if $z$ is fixed and $x + y + z = 3a$ with $x, y, z ≥ 0$,
  then $xy \le \left(\frac{3a − z}{2}\right)^2$ with equality only if $x = y = (3a − z)/2$.
  Thus if $x + y + z = 3a$ with $x, y, z ≥ 0$, (i) with $n = 3$, yields
  $xyz \le z\left(\frac{3a-z}{2}\right)^2 \le a^3$ with equality only if $x = y = z = a$.

I'm struggling to even gain a foothold in this solution as I really don't understand it at all. Can anyone explain what values the author inputs into the function and how his solution works? 
 [/INST] First, show that $xy\le\left(\frac{x+y}{2}\right)^2$.
This can be done by applying your result with $n=2$ and $a = \frac{x+y}{2}$. Indeed, we get
$$ x\left(\frac{2a-x}{2-1}\right)^{2-1} \le a\left(\frac{2a-a}{2-1}\right)^{2-1} = a^2 $$
since the function $x\mapsto x\left(\frac{2a-x}{2-1}\right)^{2-1}$ attains a maximum at $x=a$. Notice that $2a-x = y$, so we get $xy\le a^2 = \left(\frac{x+y}{2}\right)^2$, as desired.
In particular, if we now write $x+y+z=3a$, then $x+y = 3a-z$, and so we get $xy\le\left(\frac{3a-z}{2}\right)^2$.
Now, we apply your result with $n=3$, $a = \frac{x+y+z}{3}$, and "$x$" replaced by "$z$". We then get
$$ z\left(\frac{3a-z}{3-1}\right)^{3-1}\le a\left(\frac{3a-a}{3-1}\right)^{3-1} = a^3, $$
i.e. $z\left(\frac{3a-z}{2}\right)^2\le a^3$. Since we already had $xy\le\left(\frac{3a-z}{2}\right)^2$, this implies
$$ xyz\le z\left(\frac{3a-z}{2}\right)^2 \le a^3 = \left(\frac{x+y+z}{3}\right)^3,$$
as desired.
</s>