Trigger for removing group with no users left in
If you don't specify FOR EACH ROW in your CREATE TRIGGER statement, it will default to FOR EACH STATEMENT.  In this case, the OLD and NEW records will never be assigned - in the end, which row should they refer to, if you change, for example, a hundred of them?
So, create your trigger as follows:
CREATE TRIGGER TR1
       AFTER DELETE
       ON GROUP_MEMBERSHIP
       FOR EACH ROW
       EXECUTE PROCEDURE DELETE_EMPTY_GROUPS();

Using the idea from @Darwin von Corax, you could also use a FOR EACH STATEMENT trigger to remove all groups that are now empty:
CREATE OR REPLACE FUNCTION DELETE_EMPTY_GROUPS()
RETURNS TRIGGER AS
$$
BEGIN
    PERFORM DELETE_GROUP(g.ID)
    FROM GROUPS AS g
    WHERE NOT EXISTS (
        SELECT 1
        FROM GROUP_MEMBERSHIP AS gm
        WHERE gm.ID_GROUP = g.ID
    );
    RETURN NULL;
END
$$
LANGUAGE 'plpgsql';


CREATE TRIGGER TR1
   AFTER DELETE
   ON GROUP_MEMBERSHIP
   FOR EACH STATEMENT
   EXECUTE PROCEDURE DELETE_EMPTY_GROUPS();
   

Notes:

I believe the trigger should be defined as AFTER DELETE in both cases.
I also believe that your function throws an error (ERROR:  query has no destination for result data) - use PERFORM instead of SELECT.
If you delete many rows (group memberships) at a time, the FOR EACH STATEMENT trigger might be more efficient, as it fires only once.