Solution to the new version: $X$ has this property if and only if it does not contain a countably infinite set of isolated points every infinite subset of which has a cluster point.
In one direction, if $X$ does contain such a configuration, then the counterexample given in my other answer generalizes straightforwardly. Conversely, suppose it contains no such configuration and suppose $f: X \to \mathbb{R}$ is continuous and $A_f$ is infinite. There are two possibilities. First, suppose that for some $\epsilon > 0$ the set $\{x \in X: |f(x)| \geq \epsilon\}$ is infinite. Then find a continuous function $\phi: \mathbb{R} \to \mathbb{R}$ such that $\phi(t) = \frac{1}{t}$ for $|t| \geq \epsilon$. The function $g = \phi \circ f$ then has $\Gamma(g) \cap A_f$ infinite, so $f$ is not a counterexample. Otherwise, suppose that the set $\{x \in X: |f(x)| \geq \epsilon\}$ is finite for every $\epsilon > 0$. By the assumption on $X$ we can find an infinite subset $S$ of $\{x: f(x) \neq 0\}$ that has no cluster point. Then define $g(x) = \frac{1}{f(x)}$ when $x \in S$ and $g(x) = 0$ when $x \not\in S$. Then $g$ is continuous and $\Gamma(g) \cap A_f$ is infinite, so again $f$ is not a counterexample.