Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
You may apply Chow's lemma and minimal resolution to reduce to the case when $X$ is a smooth projective surface, no need to get so involved with such things. On the other hand, your $f$ is not a zero divisor of $R/I$, for otherwise, $C$ is a component of $D$ (your assumption).
@NickL The original question has many other assumptions, I just wonder what happens if removing all the assumptions. I would appreciate you copy this comment to an answer, I guess you mean $X:=$ blowup of $\mathbb{P}^2$, right? It has finite morphism to $\mathbb{P}^2$.