When/why does the principle of least action plus boundary conditions not uniquely specify a path? A few months ago I was telling high school students about Fermat's principle. 
You can use it to show that light reflects off a surface at equal angles. To set it up, you put in boundary conditions, like "the light starts at A and ends at B". But these conditions by themselves are insufficient to determine what the path is, because there's an extra irrelevant stationary time path, which is the light going directly from A to B without ever bouncing off the surface. We get rid of this by adding in another boundary condition, i.e. that we only care about paths that actually do bounce. Then the solution is unique.
Of course the second I finished saying this one of the students asked "what if you're inside an elliptical mirror, and A and B are the two foci?" In this case, you can impose the condition "we only care about paths that hit the mirror", but this doesn't nail down the path at all because any path that consists of a straight line from A to the mirror, followed by a straight line to B, will take equal time! So in this case the principle tells us nothing at all.
The fact that we can get no information whatsoever from an action principle feels disturbing. I thought the standard model was based on one of those!
My questions are


*

*Is this anything more than a mathematical curiosity? Does this come up as a problem/obstacle in higher physics?

*Is there a nicer, mathematically natural way to state the "only count bouncing paths" condition? Also, is there a "nice" condition that specifies a path in the ellipse case?

*What should I have told that student?

 A: Multiple classical solutions to Euler-Lagrange equations with pertinent/well-posed boundary conditions (such solutions are sometimes called instantons) are a common phenomenon in physics, cf. e.g. this related Phys.SE post and links therein. 
In optics, it is well-known that already e.g. two mirrors can create multiple classical paths.
A: Actually, the extra path is not irrelevant. If you put a light bulb at A and a $4\pi$ detector (this means $4\pi$ steradian coverage, i.e. it detects incoming light in any direction) at B, the detector will see light along both paths: direct, and bounced off the mirror, which is exactly the result you got from Fermat's Principle. If you want to exclude the direct path, you have to block it with an opaque wall.
The same thing goes for the elliptical mirror: the detector will see light coming in from every direction, which is again just what Fermat's Principle tells you: every path has stationary (i.e. zero first-order variation) travel time, and thus every path is a valid one for the light.
In Lagrangian mechanics, on the other hand, the state of the system contains both position and velocity - it's a state in phase space, not real space. You don't have to deal with reflections in phase space, and that usually rules out these cases where you have an infinite number of paths by which a particle could get from state A to state B.
A: 
Is this anything more than a mathematical curiosity? 

It is not a curiosity. The light travels all those paths.

Does this come up as a problem/obstacle in higher physics?

I'm not sure what the "this" is. Yes, people will sometimes wrongly think there is a unique solution when there isn't. There can be multiple geodesics between the same events (even if for small enough regions this isn't true), there can be multiple solutions to $F=ma.$ But how important is it to have a unique solution?
Sure, doing a path integral could be annoying when there isn't a unique path, but if those failures are small in a measure theoretic way it doesn't matter. But people aren't exposed to measure theory early on. So they can get confused by anything, like that something that happens with probability 1 can fail to happen or that something that happens with probability 0 can happen. They can happen but it isn't supposed to be a big deal.
That's a general symptom of people trying to be sold oversimplified stories, it's great to build physical intuition but it isn't right to let people think that their intuitions are more correct than they are.

Is there a nicer, mathematically natural way to state the "only count bouncing paths" condition? 

Nope, that is wrong.

Also, is there a "nice" condition that specifies a path in the ellipse case?

You are aiming to prove that a unique path is followed when it isn't.

What should I have told that student?

You could clearly separate an expectation from a requirement. The probability 1 examples might be helpful since many of the non unique paths happen with probability 0 if you randomly pick initial conditions.
If you lay down that the purpose of science is to make predictions and that biases or expectations can bite you, then teaching relativity and quantum mechanics and general relativity later on might go better if people can set aside their baggage and admit that they just want to learn a theory to see what the theory predicts and see if the theory agrees with what we see. And that a theory doesn't have to respect your human opinions about what you think it should or shouldn't do.
In this case the prediction is whether a detector sees light from a particular direction at a particular time. If light is leaving in many direction it is reasonable to think it can arrive from many directions. Since there are beam splitters and half silvered mirrors it can arrive from multiple directions even if it heads out in just one.
You could even play laser maze, it's a real game (ages 8+, no affiliation).
As for your title question I'm interested in an answer because I hear people say there are unique solutions all the time, but they even say that when there are not unique solution so I don't know why they say that. In either sense of why, I don't know what theorem they are thinking of or even why they want such a result. Just  .... why?
A: 
What should I have told that student?

The Fermat principle is interesting, but when in doubt use the basic laws of reflection and refraction.
It is also good to realize the Fermat principle does not give one actual path which light ray will follow, it gives the possible paths. Which ones will be realized depends also on things like orientation of the light ray source. If the light source in one focus shines in all directions, all those rays from one focus to another are going to be realized.
A: Fermat's principle says the path with minimum optical path or minimum time is chosen by light. It can be direct or indirect (containing reflections or refractions). But as others said, it's not necessarily unique, because there might be paths all with minimum optical paths, that means, all with equal minimum optical paths. That's exactly what happens in an elliptical mirror. It's the definition of ellipse that all paths between the two foci which include a reflection are equal. That's why the image of the object in one focus is formed in the other focus. If all the paths were not equal there wouldn't necessarily be a constructive interference leading to image formation. They are all minimum paths and they are REALLY chosen by light. But there are always some barriers (like your hand holding the light source) that block some of these paths. Then light won't bypass, because this new path is not a minimum path anymore. As for the direct path between the two foci, it is also a minimum, but with respect to paths in its neighborhood, not the paths mentioned above. So it is a choice too. 
A: There's another extremely conceptually important class of situations in which there are multiple stationary-action trajectories with the same boundary conditions: situations in which the Lagrangian has a symmetry that leaves the boundary conditions invariant but changes the trajectory that connects them.
The simplest example is just a point object confined to the surface of a sphere and feeling the influence of gravity, which starts out initially balanced right at the top of the sphere. Clearly if you wait long enough, it will eventually slip off the top and eventually end up at the bottom. But given the boundary conditions "starts off at the top" and "ends up at the bottom a time $T$ later", which line of longitude does it go down to get there? There obviously can't be a single correct answer by the sphere's axial symmetry, but the object does physically end up sliding down one line. This concept is known as "spontaneous symmetry breaking" and is cornerstone of much of physics. The literature on this subject is truly staggeringly large, so you won't have a problem finding more info.
A: I'm aware this question was submitted 7 years ago. It may be that in the years since you have found an answer to it through other means.  Then again, maybe not, so I'm posting this answer.
1 Hamilton's stationary action
I will first show that for Hamilton's stationary action a similar case exists: a case where there is a range of paths with identical value for the corresponding action. In order to narrow down to a specific trajectory an initial condition must be provided.
2 Huygens' wavefront hypothesis
I will provide a derivation of Fermat's stationary time from Huygens' wavefront hypothesis. (The usual derivation, of course, is show that Fermat's stationary time produces Snell's law. I will explain why I proceed from Huygens' wavefront hypothesis as starting point.)
3 What gives?
The observation that in some cases the path is not uniquely determined must be accommodated. I will discuss how to proceed.


As you state: the mirror curved to ellipse shape is a case where there is a range of paths that all have the same Fermat action; all take the same amount of time to traverse.
Hamilton's stationary action has a similar case:
Idealized harmonic oscillation has the following property: the potential energy increases quadratic with the displacement from the equilibrium point. This gives idealized harmonic oscillation a unique property: the amount of potential energy is equal to the amount of kinetic energy.
From here on I will abbreviate Idealized Harmonic Oscillation to IHO
As we know, in the case of IHO the amplitude and the period are independent; all amplitudes of the oscillation have the same period.

Hamilton's stationary action must corroborate: in the case of IHO the amplitude and period are independent. The following verifies that:
For the trajectory I use the sine function, and for the boundary conditions I use $t=0$ as start point and  $t=\pi$ as end point (half a cycle).
The derivative of the sine function is the cosine function, so the kinetic energy is proportional to the square of the cosine. With harmonic oscillation the potential energy is proportional to the square of the displacement. The natural choice of zero point of potential energy is to put it at zero displacement.
Using $S$ for Hamilton's action, and a multiplication factor $a$ for amplitude:
$$ S = \int_0^{\pi} \left( \tfrac{1}{2} \left( a \cdot \cos(t) \right)^2 - \tfrac{1}{2} \left( a \cdot \sin(t) \right)^2 \right) dt   \tag{1.1} $$
(I may have botched a minus sign in the above equation, or worse, but you get my drift.)
When evaluated for exactly half a cycle of the oscillation (or an integer multiple of half a cycle): the squared sine and the squared cosine will drop away against each other, and the multiplication factor $a$ will drop away with them.
So we have corroboration: in the case of IHO: when the boundary conditions are set to evaluate half a cycle (or integer multiple) then for every amplitude the value of Hamilton's action is identical.

Of course, this property of IHO never presents itself as an obstacle. The equation that is actually used is the Euler-Lagrange equation; a differential equation. When using a differential equation the way to narrow down to a single trajectory is to provide sufficiently constraining initial conditions.
What textbook authors do is this: Hamilton's stationary action is used as a context to derive the Euler-Lagrange equation. When Lagrangian mechanics is applied the equation that is used is the Euler-Lagrange equation, not the originating action concept.


2 Huygens' wavefront hypothesis
(I prefer the name 'wavefront hypothesis' over Huygens' principle. In my opinion the qualification ‘Principle’ is used too often. If everything is a principle then the word ‘principle’ is rendered meaningless.)
We have that the body of observations of refraction can be expressed with a single empirical law: Snell's law.
Fermat's stationary time and Huygens' wavefront hypothesis have the following in common: they seek to account for Snell's law by supposing that the speed of light, while many orders of magnitude faster than anything else, is finite, that the speed of light in each medium is a constant, and that for each medium the index of refraction is the inverse of the speed of light in that medium. Implication: with a constant speed of light  (for each specific medium) there is (for each medium) a fixed ratio of distance traveled and the time it takes to traverse.


Diagram 1, Wavefront reconstitution
The diagram also has a factor 'd' for the width of the propagating wavefront, but this width does not affect the refraction angle, and accordingly in the equations the factor 'd' drops away.


Diagram 2 (animated GIF), relation between length of hypotenuse C and opposite side A
In preparation I derive an expression for the rate of change of the hypotenuse C's length as the length of the opposing side A changes:
$$ \frac{dC}{dA} = \frac{d(\sqrt{A^2 + B^2})}{dA} = \frac{A}{\sqrt{A^2+B^2}} = \frac{A}{C}  \tag{2.1} $$
with the intermediate steps removed:
$$ \frac{dC}{dA} = \frac{A}{C} \tag{2.2}  $$


Diagram 3, Fermat's stationary time
In Diagram 3 the letter 'S' stands for ‘Snell's point’. I take as starting point that there is a fixed point from where the light is transmitted, point 'T', and that there is a fixed point 'R' where the light is received. (T and R not shown in the image; T and R can be arbitrarily far away.)
Let it be granted that the wavefront is perpendicular to the direction of propagation: it follows that the angle $\beta_1$ is equal to the angle $\alpha_1$, and that the angle $\beta_2$ is equal to the angle $\alpha_2$.
The variation of the path of the light consists of moving point S along the refraction line. I want to find the criterion that identifies the location of point S in the variation space such that Snell's law is satisfied.
(2.3) is another way of stating Snell's law:
$$ \frac{\sin(\alpha_1)}{v_1} = \frac{\sin(\alpha_2)}{v_2}  \tag{2.3} $$
I set up expressions for $\sin(\alpha_1)$ and $\sin(\alpha_2)$ according to (2.2):
$$ \sin(\alpha_1) = \frac{dC_1}{dA_1}  \qquad \sin(\alpha_2) = \frac{dC_2}{dA_2} \tag{2.4} $$
Next I use the supposition that in every specific medium the speed of light is a constant. For every medium the ratio of distance and time is fixed.
$$ \frac{C_1}{v_1} = T_1 \qquad \frac{C_2}{v_2} = T_2  \tag{2.5} $$
Combining (2.3), (2.4) and (2.5):
$$ \frac{dT_1}{dA_1} = \frac{dT_2}{dA_2} \tag{2.6}  $$
Diagram 3 illustrates that when Snell's point 'S' is moved the sides $A_1$ and $A_2$ change by the same amount. Therefore (2.6) can also be expressed as derivatives with respect to the position of point 'S'
$$ \frac{dT_1}{dS} = -\frac{dT_2}{dS}  \tag{2.7} $$
Which can be rearranged as follows:
$$ \frac{d(T_1 + T_2)}{dS} = 0  \tag{2.8} $$
The derivation above explains how Fermat's stationary time comes about.
Equation (2.6) looks as if it is about time, but in fact (2.6) is expressing the relation between the angles $\beta_1$ and $\beta_2$
The distance traveled from the point of emission to Snell's point is immaterial, it is the angle that counts. (And just as well of course the distance traveled from Snell's point to the point of reception is immaterial; it is the angle that counts.)
There is the total time $(T_1 + T_2)$, but this total time is only indirectly a factor.
Fermat's stationary time hinges on taking the derivative of the travel time with respect to the position coordinate. The significance of the differentiation: it recovers the angle because differentiation produces a ratio.


What gives?
In addition to the case of a mirror curved to ellipse shape there is also the multiple prisms case depicted in diagram 4

Diagram 4, a set of prisms
In Diagram 4 there are three paths available for the light to go from a single start point to a single end point, each with different duration. At the end point we observe the light coming in from three directions; the light has taken all three paths. The light has taken the path with the least amount of time, and the path with the most amount of time, and the in-between path.
Diagram 4 illustrates that Fermat's stationary time criterion is actually very permissive. It is only in some rare cases that Fermat's stationary time provides sufficient constraint to give a unique solution.
In physics textbooks: when Fermat's stationary time criterion is introduced the case presented is always the same case, one of the rare cases where Fermat's stationary time criterion fortuitously gives a unique solution.

The fact that generally Fermat's stationary time does not give a unique solution is discussed in the book "Introduction to Optics" by Frank L. Pedrotti, Leno M. Pedrotti and Leno S. Pedrotti.
Pedrotti, Pedrotti and Pedrotti offer the following discussion:

Situations exist where the actual path taken by a light ray may represent a maximum time or even one of many possible paths, all requiring equal time. [...] A more precise statement of Fermat’s principle, which requires merely an extremum relative to neighboring paths, may be given as follows: The actual path taken by a light ray in its propagation between two given points in an optical system is such as to make its optical path equal, in the first approximation, to other paths closely adjacent to the actual one.

I surmise the Pedrotti "more precise statement" goes like this:
When you encounter a case where multiple paths are available: divide the space into subsections, such that each subsection contains only one path. Then within each subsection Fermat's stationary time criterion will find a single path.
The Pedrotti strategy is in the right direction, but more of the same is needed.


When Fermat's stationary time is presented as a way of accounting for Snell's law of refraction there is a tacit assumption that Fermat's stationary time operates as a global criterion.
Interestingly: if you apply Fermat's stationary time as a local criterion you still obtain the same path.
For instance, in the case depicted in diagram 1:
Divide the total path in subsections.
Then iterate over those subsections.
-All subsections that do not contain the refraction line: Fermat's stationary time criterion gives a straight line for the path in that subsection, aligned with the adjacent subsections.
-In the one subsection that contains the refraction line: apply Fermat's stationary time criterion locally.
The combination of applying locally and iterating produces the result that satisfies Snell's law.

For comparison let me present how Jacob Bernoulli approached the Brachistochrone problem.
The Brachistochrone challenge was issued in the 1690's, by Johann Bernoulli, the younger brother of Jacob Bernoulli. At the time Jacob Bernoulli was among the few mathematicians able to solve the Brachistochrone problem.
Development of calculus of variations occurred much later, in the 1780's, so Jacob Bernoulli did not have Calculus of variations, nor any precursor of it.

Jacob Bernoulli recognized a crucial feature of the brachistochrone problem, and he presented that feature in the form of a lemma:

Let ACEDB be the desired curve along which a heavy point falls from A to B in the shortest time, and let C and D be two points on it as close together as we like. Then the segment of arc CED is among all segments of arc with C and D as end points the segment that a heavy point falling from A traverses in the shortest time. Indeed, if another segment of arc CFD were traversed in a shorter time, then the point would move along AGFDB in a shorter time than along ACEDB, which is contrary to our supposition.
(Acta Eruditorum, May 1697, pp. 211-217)
Every subsection of the brachistochrone is by itself an instance of the brachistochrone problem. Therefore the following strategy will work:
Divide the curve in a concatenation of subsections, and set up an equation that is concurrently valid for whole set of concatenated subsections. Take the limit of infinitisimally short subsections.
Generalizing:
In order for the derivative of $\int_{x_2}^{x_1}$ to be zero: divide the domain in concatenated subsections, and set the condition: for every subsection the derivative of the corresponding integral must be zero concurrently. Take the limit of infinitisimally short subsections.

The way to proceed is to relinquish the tacit assumption that Fermat's stationary time operates as a global criterion.
Fermat's stationary time operates locally, operating concurrently on a concatenated set of subdivisions of the path.

In an october 2021 answer I discussed how the considerations above apply in the case of Hamiltons' stationary action
