You need "so" for it to make sense.
Both are correct with so.
Why didn't you say so sooner?
Why didn't you say so earlier?
There is a slight difference in meaning.
"earlier" sounds much closer to the current time. It is within the same day, often hours beforehand.
"sooner" sounds much broader in scope. It could be days, weeks, even months before the comment is made.
Why didn't you say anything/something sooner/earlier?
You can use "anything" or "something" instead of "so"?
I would say the meaning is the same. But in some cases it sounds more natural to say "so" / it's more common to say "so". But the meaning is the same.