Confusing Lagrange multipliers question
This is quite correct way.
Obtained solution for the stationary point $$\hat x_i = \dfrac{e^{a_i}}{\sum\limits_{j=1}^ne^{a_j}}$$ corresponds to the constraints.
The value is $$f\left(\hat x\right) = \sum\limits_{i=1}^n \dfrac{a_ie^{a_i}}{\sum\limits_{j=1}^ne^{a_j}} - \sum\limits_{i=1}^n\dfrac{e^{a_i}}{\sum\limits_{j=1}^ne^{a_j}}\log\dfrac{e^{a_i}}{\sum\limits_{j=1}^ne^{a_j}} = \sum\limits_{i=1}^n \dfrac{e^{a_i}}{\sum\limits_{j=1}^ne^{a_j}} \left(a_i - \log\dfrac{e^{a_i}}{\sum\limits_{j=1}^ne^{a_j}}\right)\\ = \sum\limits_{i=1}^n \dfrac{e^{a_i}}{\sum\limits_{j=1}^ne^{a_j}} \left(\log e^{a_i} - \log e^{a_i}+\log{\sum\limits_{j=1}^ne^{a_j}}\right) = \sum\limits_{i=1}^n\dfrac{e^{a_i}\log{\sum\limits_{j=1}^ne^{a_j}}}{\sum\limits_{j=1}^ne^{a_j}} = \log{\sum\limits_{j=1}^ne^{a_j}}.$$ The task in every border is similar, with some subset of $\{a_i\}$ instead the issue set $\{a_i\}.$ So the stationary points values in the borders contain some part of the issue sum terms. At this time, last level sums, every of which contains the single value $a_i,$ present $1D$ tasks with zeros on the edges and correspond with the maxima.
Since $\forall(i)e^{a_i}>0,$ the value $f\left(\hat x\right)$ is maximum.