Under what circumstances is it acceptable to assume all variables will be equal in optimization problems? I'm sorry for the general and kind of inaccurate title, but I'm not sure how to phrase this question in a super short way.
In calculus class a few years ago, this question was given:

Choose three positive numbers $x, y,$ and $z$, so that $x + y + z = 99$ so that $x \dot{} y \dot{} z$ is as large as possible.

We were supposed to combine the equations and take the derivative to find the maximum, but I immediately made the assumption that, because both involved equations treated $x, y,$ and $z$ exactly the same, they would all have the same value in the solution.
So I said that $x, y,$ and $z$ were all 33, and whaddaya know, that answer was right. My teacher of course said that that trick would not work in every optimization problem, but it has come in handy for a few other problems.
For a while, I thought that I could assume that all variables would have the same value in any problem where they were all treated the same, but I recently thought, "What if the question had asked me to minimize $x \dot{} y \dot{} z$ instead of maximize it? Then in the solution, one of the variables would have to be zero, and there would be infinite possibilities for the other two, none of which would result in $x, y,$ and $z$ being all equal, so there must be some other factor involved in whether or not this trick will work.
Is there some kind of test where I can look at a problem where the variables are treated the same in every equation and tell whether or not assuming that the values will all be the same in the solution or not?
 A: If the constraints and the function to be optimized are both symmetric with respect to a group of permutations of the variables, then the solution set will also be symmetric with respect to this group.
In your first example, the solution set consisted only of a single point $(x, y, z)$, so in order for this to be invariant under all permutations, we must have $x = y = z$. But your solution set may consist of more than one point, and then the action of the permutation group on the solution set will not necessarily fix all the points.
When you try to minimize $xyz$ under the given constraints, the solution set is $\{(0, t, 99 - t): 0 \lt t \lt 99\} \cup \{(t, 0, 99 - t): 0 \lt t \lt 99\} \cup \{(t, 99 - t, 0): 0 \lt t \lt 99\}$.
We have an action of $S_3$ (the group of permutations of $3$ elements) on the coordinates of the points, produced by permuting these coordinates.
For example, the permutation $(12)$ that sends $1$ to $2$, $2$ to $1$ and $3$ to itself will act on a point of the form $(0, t, 99 - t)$ to give the point $(t, 0, 99 - t)$. Note that this point is also contained in the solution set. In fact, $S_3$ is basically just permuting the subsets in the union above. You can try the same exercise with different permutations, and find that the action of every permutation in $S_3$ on every solution point gives another solution point.
So the solution set is fixed under the action of $S_3$, but the points themselves may not be necessarily (because $(0, t, 99 - t) = (t, 0, 99 - t)$ only if $t = 0$).
So finally to answer your question, we cannot always say that points maximizing or minimizing a given function under certain constraints that are all symmetric in $x, y, z$ will have their coordinates equal. But if you know, for example, that your solution set must consist of only a single point, then you can, because a point $(x, y, z)$ is invariant under permutations of the coordinates only if $(x, y, z) = (y, z, x) = (z, x, y)$ and thus $x = y = z$.
If your solution set consists of more than $1$ point, then you will need to find additional symmetries in the problem (other than permutations of the variables), or additional information on the solution set, to be able to conclude more.

[Vague aside for general interest,
This idea of symmetries in the equations causing symmetries in the solutions is used in many places such as algebra as well as physics (see Noether's theorem in physics, for example)
In group theory, there is a notion of group action that generalizes the above observations. There is also a notion of stabilizer of a set (or of an element), which is a subgroup that fixes the set (or element) under the group action.
I don't know if you have had this background, but I am just mentioning this in case that it might interest you.]
A: 
Choose three positive numbers $x, y,$ and $z$, so that $x + y + z = 99$ so that $ \frac{1}{x} +  \frac{1}{y} + \frac{1}{z}$ is as large as possible.

A: Never (without reason).
Under no circumstances assume without reason that all variables must be equal. This is because, well, there's no reason that they all have to be equal. For example, consider Schur's inequality with non-symmetric equality conditions. Of course, as Tob Ernack pointed out, if not all three (or however many) variables are equal then there are multiple equality solutions.
Some reasons where you can assume they are equal (for the purposes of trying to prove that equality occurs when they are all equal, not as a proof itself) are when:


*

*You've used some type of graphing tool to confirm maximality

*^Instead of graphing, you've tried various test cases and it seems true

*It seems plausible (i.e You've tried AM-GM and it nearly works)


However, these reasons can never be used as a proof. To prove that equality occurs iff they are equal:


*

*AM-GM

*Jensen's
