Your intuition is right that when one variable is a function of the other, they are usually not independent, (although they may be uncorrelated). In this case, that rule of thumb is correct and others have given the computations and counterexamples demonstrating that.
However, remember this rule of thumb is not always right. For instance, let $X$ and $Z$ be independent RVs, having value $1$ with probability $1/2$ and $-1$ with probability $1/2.$ Then let $Y = XZ.$ $Y$ depends on $X$ in a functional sense, but it is actually independent of $X$.
However, if you replace $X$ and $Z$ in my example with standard normal variables and set $Y = XZ,$ then $X$ and $Y$ are not independent (although they are uncorrelated).
The key is that dependence means knowing one variable tells you something about the the other. In the example with normal random variables, knowing $X=1$ tells you that $Y = \pm1,$ which is new information about $Y$ since it could have been any real number. In contrast, in the example where $X$ and $Z$ are $\pm1,$ learning $X = 1$ gives you no probabilistic information about $Y.$ It's still $\pm 1$ with 50-50 probability, just like before you knew $X.$