Automatically categorize parts of a piece of writing
As far as I know there's no specific task for this, it's general text classification.  It's also related to text segmentation. There are certainly existing systems for similar tasks, but probably specific to a certain type of data.

In general this would be a supervised process, you would need a sample containing many documents in which the parts are pre-annotated. I think sequence labeling algorithms would be the standard approach.