Sort numbers using only 2 hidden layers
Doing some research, I found a paper which proves that sorting can be done with at most 3 layers, and that their solution is optimal if you restrict the size of the network to be polynomial w.r.t. to the number of input numbers:

Depth Efficient Neural Networks for Division and Related Problems, see Theorem 7 on page 955 (page 10 in the PDF).