a) You have to do that if you intend to charge money for the invention during the time of your contract. You can quit and then start using your invention. Just don't do it while your contract is running (this avoids you building a competition to your employer). b) The employer has to immediately patent or copyright the work and give you a compensation for licensing it.
This is really rather a forced license contract.
Actually, go read the law (ArbnErfG, § 18 Mitteilungspflicht, Satz (3)) says otherwise:
(3) Eine Verpflichtung zur Mitteilung freier Erfindungen besteht nicht, wenn die Erfindung offensichtlich im Arbeitsbereich des Betriebes des Arbeitgebers nicht verwendbar ist.
You only have to ask your employer if the invention was made in the course of your work (during work time) or part of the employers business. Totally unrelated inventions made in your free time are _not_ covered by the law.
It was an other situation, but a lawyer once told me, what happens when such things go to court: The corporation will bring 10 witnesses against you and will bring 10 experts certifying what the corporation needs.
And than you will be very alone and be gracious to get even a little money. You will loose your job anyway.
In general, german courts are quite employee friendly, so seriously, your employer would probably be at least as afraid to go to court as you'd be. Maybe not if it's a litigation-happy megacorp, but the bulk of german companies is medium-sized (Mittelstand) and they tend to shy away from court cases.