Gaddock Teeg prevents casting noncreature spells with a converted mana cost (mana value) of 4 or greater, AND noncreature spells with X in their mana cost. These are two separate restrictions, and the second one applies to any spell that simply has X in its mana cost — the value chosen for X is irrelevant to whether the restriction applies.
When determining whether a spell has X in its mana cost, you look at the printed mana cost on the card (CR 202.1). Spells like Fireball or Blue Sun's Zenith have {X} in their printed mana costs, so Teeg's second restriction always blocks them, even if you would choose X = 0.
The mana value rule for spells on the stack does treat X as whatever value was chosen (CR 202.3b), but Teeg's restriction doesn't check mana value for the 'X in the cost' clause — it checks whether the symbol X literally appears in the cost. Choosing X = 0 does not remove the X symbol from the mana cost.
Concrete example: You want to cast펑 Chalice of the Void with X = 0. Even though the mana value on the stack would be 0, Gaddock Teeg's second ability still applies because Chalice of the Void has {X}{X} in its printed mana cost. You cannot cast it while Teeg is on the battlefield.
Note that if a noncreature spell happens to have X in its cost AND a resulting mana value of 4 or more, either restriction alone would be enough to prevent it. Both restrictions are independent (CR 601.2).
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.