This is an exercise from the book Algebraic Geometry I by Görtz and Wedhorn:
Show that $Z=V(TU,T^2)\subset \rm{Spec}(k[T,U])=X$ is closed irreducible of codimension $1$, but there is no $f\in k[T,U]$ satisfying $V(f)=Z$.
I have my doubts that this exercise is correct for the following reason:
I computed $$\sqrt{(TU,T^2)}=\sqrt{\sqrt{(TU)}+\sqrt{(T^2)}}$$ and furthermore $\sqrt{(TU)}=\sqrt{(T)}\cap\sqrt{(U)}=(TU)$ by comaximality and $\sqrt{(T^2)}=(T)$ since $(T)$ is prime. Hence we find $\sqrt{(TU,T^2)}=(T)$ which implies $V(TU,T^2)=V(T)$, contradicting the claim made in the exercise.
Is my reasoning correct or did I make a mistake somewhere?
Your work shows that $V(TU,T^2)$ and $V(T)$ have the same underlying topological space, but not that they are isomorphic as schemes. If they were isomorphic as schemes, then $k[T,U]/(T^2,TU)$ would be isomorphic to $k[T,U]/(T)\cong k[U]$ as rings, which cannot be true as the first contains nontrivial zero-divisors ($T$, for example) while the second does not.
This does show that $V(TU,T^2)$ is irreducible and codimension one - this combined with the fact that $V(I)$ is closed for any ideal $I$ shows that you've successfully completed the first portion of the problem. All that's left is checking the claim about the non-existence of $f$.