Neural networks are commonly used for classification tasks, in fact from this [post][1] it seems like that's where they shine brightest.  

However, when we want to classify using neural networks, we often have the **last** layer to take values in $[0,1]$; typically, by taking the last layer to be the *sigmoid* function $x \mapsto \frac{e^x}{e^x +1}$.  Is this theoretically justified?  (i.e., is there an analogue to the [universal approximation theorem][2] for this case)? Why can the output of the neural network be in the range $[0,1]$ if it performs classification?



  [1]: https://ai.stackexchange.com/q/18576/2444
  [2]: https://en.wikipedia.org/wiki/Universal_approximation_theorem