Undefined message showing while new category adding?

Check whether is there any space before or after php opening and closing tag respectively in functions.php.

If not deactivate each plugin and identify which plugin causes the issue, Then remove the extra space in that plugin after php closing tag.