Repeat total count value
The GROUP BY id is useless in the query, since there is only one row for every id (it appears to be the primary key of the table).

What you need a count over the whole result. This is easy using a window aggregate:

SELECT count(*) OVER () AS total_count, 
       id, parent_id
FROM paths 
WHERE parent_id = 5 ; 




The last requirement is rather weird but you could have that, too, with a more complicated construct:

SELECT count(p.id) OVER () AS total_count, 
       p.id, p.parent_id
FROM (SELECT 1) AS dummy
  LEFT JOIN paths AS p
    ON p.parent_id = 5 ;