I learned in school that we don't split the dataset into training and testing sets if the sample size is less than 30. I wonder why we don't?
Depends on what the task is, but generally, train-test splitting data with small sample size will lead to an even smaller training set. The model can't effectively "learn" on such small dataset. As a result the learned parameters are not what we are looking for. This will especially be more true regarding the classification tasks, which will lead to extensive imbalances in the dependent data as well.