Mistake in a problem solution
-- SET A MARK (RST=1) EVERY TIME PREVIOUS END_DATE IS NOT EQUAL START_DATE
WITH CT AS
(
    SELECT 
        TASK_ID, START_DATE, END_DATE,
        CASE WHEN (COALESCE(LAG(END_DATE) OVER (ORDER BY START_DATE), END_DATE) = START_DATE)
             THEN 0 ELSE 1 END RST
    FROM
        TASK
)
-- SUM(RST) TO SET A GROUP (1, 2, 3, ...)
, CT2 AS
(
    SELECT
        TASK_ID, START_DATE, END_DATE,
        SUM(RST) OVER (ORDER BY START_DATE) AS GRP
    FROM
        CT
)
SELECT 
    MIN(START_DATE) AS START_DATE,
    MAX(END_DATE) AS END_DATE
FROM 
    CT2
GROUP BY
    GRP;




START_DATE          | END_DATE           
:------------------ | :------------------
01/10/2015 00:00:00 | 04/10/2015 00:00:00
13/10/2015 00:00:00 | 15/10/2015 00:00:00
28/10/2015 00:00:00 | 29/10/2015 00:00:00
30/10/2015 00:00:00 | 31/10/2015 00:00:00



db&lt;>fiddle here