What is wrong with my solution for finding $f_Y$ if $Y = X^n$? I have a solution to the following problem without using all the assumptions,  and I am wondering if my solution is wrong as a result.

Let $X$ be a continuous nonnegative random variable with density function $f_X$, and let $Y = X^n$. Find $f_Y$, the probability density function of $Y$ in terms of $f_X$.

This question is answered here using the cumulative distribution functions of $X$ and $Y$, and this solution uses the fact $X$ is non-negative. I think I have a different solution that arrives at the same answer without using the fact $X$ is non-negative as shown below:
Since $Y = X^n$, we have $dy  = nx^{n-1}dx$ and so
\begin{align*}
f_Y(y) &= \int_{-\infty}^{\infty} f(x, y)\, dx\\
&= \int_{-\infty}^{\infty} f(x, y)\, (\frac{dy}{nx^{n-1}})\\
&= \frac{1}{nx^{n-1}}\int_{-\infty}^{\infty} f(x, y)\,dy\\
&=  \frac{f_X(x)}{nx^{n-1}}
\end{align*}
Why is this solution wrong, or where do I need the assmption $X\ge 0$?
Edit: From my interpretation of Ingix's answer, I think a better solution would be:
\begin{align*}
f_Y(y) &= \int_{-\infty}^{\infty} f(x, y)\, dx\\
&= \int_{0}^{\infty} f(x, y)\, dx\tag{Since $x\ge 0$}\\
&= \int_{0}^{\infty} f(x, y)\, (\frac{dy}{nx^{n-1}})\tag{Using the subtitution $y = x^n$}\\
&= \frac{1}{nx^{n-1}}\int_{0}^{\infty} f(x, y)\,dy\\
&=  \frac{f_X(x)}{nx^{n-1}}\tag{as $f(x,y) = 0$ for $y\neq x^n$}
\end{align*}
 A: To see that your formula is (generally) incorrect for random $Xs$ that can be negative and even $n$, consider $X_1$ being a random variable uniformely distributed on the interval $[0,1]$ and $X_2$ uniformely distributed on the interval $[-1,1]$. Obviously $f_{X_1}(t) = 1 = 2 f_{X_2}(t)$ for any $t \in [0,1]$.
However, both $Y_i=X_i^2 (i=1,2)$ have the same distribution, because $Y_i$ depends only on $|X_i|$, and both $|X_1|$ and $|X_2|$ have the same distribution (uniform on $[0,1]$).
As has been established, your end result is correct for non-negative $X$, so your formula will correctly get $f_{Y_1}(y)$, but incorrectly get $f_{Y_2}(y)$, because the $f_{X_{1,2}}(x)$ are different but the result should be the same (and the formula is linear (so injective) in $f_{X}(x))$.
The reason for this error is that in order to do the differential substitution you did, going from $dx$ to $dy$, you also need to transform the integral bounds, and in that process you need to establish the areas where your transformation function is monotone, to possibly split the integral into more than one. 
For odd $n$, this is not a problem, as $y=x^n$ is increasing. When only considering non-negative $X$, this isn't a problem for even $n$, as the integral effectively goes from $0$ to $\infty$, and $y=x^n$ is increasing in that interval as well. But it falls down if you have potentially negative values and even $n$.
Another hint that something is not as it should be with your formula is that for even $n$, there are two $x$ that satisfy $y=x^n$ for a given posiive $y$. Which one should it be in your formula, considering the density function might be different for them?
A: Your solution is wrong because you seem to pull the relation $f(x,y)dx = f(x,y)\frac{dy}{nx^{n-1}}$ out of a hat(I'm not entirely sure if it's true, it may be). Before using such a strong assumption about X and Y you would have to justify it and the only thing we know about f(x,y) is that it is the derivative of $P(X \leq x, Y \leq y)$ so we seem to get back to the solution in the link, sort of. 
