How did x become -sqrt(x^2)? 
In computing the limit as $x \to -\infty$, we must remember that for $x<0$, we have $\sqrt{x^2} = |x| = -x$. So when we divide the numerator by $x<0$, we get
  $$
\frac{\sqrt{2x^2+1}}{x}
 = \frac{\sqrt{2x^2+1}}{-\sqrt{x^2}}
 = - \sqrt{\frac{2x^2+1}{x^2}}
 = - \sqrt{2 + \frac{1}{x^2}}
$$

How did the denominator change from $x$ to $-\sqrt{x^2}$ ? I can't seem to understand.
I'm mainly confused by where the negative came from. 

Because we are looking at the limit $x\rightarrow-\infty,$ our target is negative x from the limit's perspective. That means since the value $\sqrt{x^2}=|x|$ (you can confirm this by doing casework on positive and negative values - note that square roots are always positive!), $\sqrt{x^2}=|x|=-x$ since $|x|=-x$ for negative x.
(since $-x=\sqrt{x^2}$ we can negate both sides to get $x=-\sqrt{x^2}$)
