Hi,
You don't necessarily have to use DI container. For working with Kentico APIs you can still use something like:
var membershipActivityLogger = CMS.Core.Service.Resolve<IMembershipActivityLogger>();
But still, it's a best practice to use DI and I would recommend to use it in the development.