From normal distribution to the lognormal distrubtion; where does $1/x$ come from? So the normal distribution is given by $\frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)$; Now the lognormal distribution is related to this by $y = e^x$ so the distrbution should be $\frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(\ln(y)-\mu)^2}{2\sigma^2}\right)$, but apparently it is $\frac{1}{\color{red}{y}\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(\ln(y)-\mu)^2}{2\sigma^2}\right)$, so where does this $\frac{1}{\color{red}{y}}$?
It's apparent to me that this substitution is invalid, so the question is really: What's the valid way to do it?

Apply the following theorem, from Requirements for transformation functions in probability theory
Let $X$ be an absolutely continuous random variable with support $S$ and probability density function $f(x)$. Let $g: \mathbb{R} \to \mathbb{R}$ be one-to-one and differentiable on $S$. If 
$$\frac{dg^{-1}(y)}{dy}  \ne 0, \qquad \forall y \in g(S)$$
then the probability density of $Y$ is 
$$f_Y(y) = f_X(g^{-1}(y)) \left|{\frac{dg^{-1}(y)}{dy}}\right|, \qquad \forall y \in g(S)$$ 
The term $\dfrac{1}{y}$ comes from $\left|{\dfrac{dg^{-1}(y)}{dy}}\right|$, because in your case $g(x) = e^x$ and $g^{-1}(y) = \ln y$. 
