Here you go - add this as a new class in your App_Code folder. It's not inheritance per se, but it does what you need. It copies the categories from the parent document when you insert a new document.
See
Global handlers to learn more about this customization approach.
using CMS.DocumentEngine;
using CMS.SettingsProvider;
[CustomDocumentEvents]
public partial class CMSModuleLoader
{
/// <summary>
/// Attribute class that ensures the loading of custom handlers
/// </summary>
private class CustomDocumentEventsAttribute : CMSLoaderAttribute
{
/// <summary>
/// Called automatically when the application starts
/// </summary>
public override void Init()
{
// Assigns custom handlers to the appropriate events
DocumentEvents.Insert.After += Document_Insert_After;
}
private void Document_Insert_After(object sender, DocumentEventArgs e)
{
DocumentHelper.CopyDocumentCategories(e.Node.Parent.DocumentID, e.Node.DocumentID);
}
}
}