The softmax function, why?

We know that Softmax usually applied to multi-class labels with the function of $$e^{a}\over \sum e^{a}$$.

My question is will a function like $$a^{2} \over \sum a^{2}$$ mostly work also? If not, why?

Here a stand output from last activation.

In contrast to the alternative you suggested, the advantage of the softmax is that exponentiating works well with log loss, as described in section 6.2.2. of the Deep Learning book:

The aim is to define an activation function which outputs values

[...] between 0 and 1, and [...] the logarithm of the number to be well behaved for gradient-based optimization of the log-likelihood

and,

As with the logistic sigmoid, the use of the exp function works well when training the softmax to output a target value y using maximum log-likelihood. In this case, we wish to maximize $$\log P(y=i;z) =\log softmax(z)_i$$. Deﬁning the softmax in terms of exp is natural because thelogin the log-likelihood can undo the exp of the softmax [...]