Let $k$ be (an algebraically closed field) of characteristic zero.
Let $u \in k[x]$ and $I:=\langle u \rangle$, the ideal generated by $u$. Let $f \in k[x]$ with $\deg(f) \geq 2$ and $f'$ its formal derivative.
Question 1: Assume that $f,f' \in I$; is it true that necessarily $u \in k-\{0\}$? (so $I=k[x]$).
Example: $u=x^2$, $f=x^3+x^2=(x+1)x^2 \in I$. Then $f'=3x^2+2x$. If $3x^2+2x=f' \in I$, then since $3x^2 \in I$ we get that $2x \in I$, a contradiction.
In case Question 1 has a positive answer, I would like to ask about the two-dimensional case, namely:
Let $u,v \in k[x,y]$ and $I:=\langle u,v \rangle$, the ideal generated by $u$ and $v$. Let $f \in k[x,y]$ with $\deg_y(f) \geq 2$ and $f_y$ its partial derivative with respect to $y$.
Question 2: Assume that $f,f_y \in I$; what can be said about such $u$ and $v$? Perhaps $u,v \in k[x]$? (so $I \subset k[x]$).
Any hints and comments are welcome!
For Question $1$: It is not true that $I$ is the entire ring. Consider, for example, $f=(x-1)^2$ and $I=\langle x-1\rangle$. In this case, $f'=2(x-1)$, which is also in the ideal. In fact, for $f$ and $f'$ to be in the ideal, then $\gcd(f,f')\in I$, so $u$ must be a factor of $\gcd(f,f')$.
For Question $2$: I'll give a potential avenue for exploration. Instead of working in the ring of interest, try working in $k(x)[y]$. In other words, univariate polynomials in $y$ whose coefficients are rational functions of $x$. Since $k(x)$ is a field, in this setting, you can reduce part of Question $2$ to Question $1$ (although the answer may look a bit different).
For the stated Question $2$, the idea from the first question can certainly be generalized: let $g\in I$, and let $f=g^2$, then $f'=2gg'$, both of which are in $I$.
However, note that since $k[x,y]$ is not a PID, the general answer in the bivariate case is typically (significantly) more complicated. You can always try looking at $k[x][y]$, but this is not trivial. This approach is especially difficult since we don't have a Euclidean algorithm and many of the facts about gcds don't apply in this case.
For another example, you could suppose that $u=f$ and $v=f_y$. Then, without additional structure, there's not much to say. See, for example, Euler's Homogeneous Function Theorem.