May I divide by number n in order to solve $2n = n^2$ ( even in a case where $n$ is not equal to $0$)? Suppose I have the equation : $2n = n^2$. 
Dividing by $n$ ( provided $n$ is not $0$) , I get (apparently): $n = 2$. However, from another point of view, I have: 
$2n = n^2 \rightarrow  n^2 = 2n $
$\rightarrow \sqrt{n^2} = \sqrt{2n}$
$\rightarrow |n|  = \sqrt{2n}$
$\rightarrow |n| =  \sqrt{2} \cdot \sqrt{n}$
$\rightarrow  n = + \sqrt{2} \cdot \sqrt{n} \text{ or } n = - \sqrt{2} \cdot \sqrt{n}$. 
And I do not think that here $2$ is still a solution (as it appeared to be the case with the first method). 
Which method is correct, if any? 

Assuming we work in $\Bbb Z$, I would proceed as follows:
given that
$n^2 = 2n, \tag 1$
we may write
$n(n - 2) = n^2 - 2n = 0; \tag 2$
now since $\Bbb Z$ is an integral domain, we have
$n \ne 0 \Longrightarrow n - 2 = 0 \Longrightarrow n = 2; \tag 3$
this shows that 
$n = 0, 2 \tag 4$
are the only solutions to (1).
As far as the query expressed in the title is concerned, I would say that, yes, one may divide by $n$, but only in the event $n \ne 0$; this is one reason I prefer the method presented above. which in fact stresses the cancellation properties of $\Bbb Z$ over division. 
As for our OP Ray LittleRock's second proposed solution, it strikes me that it can be made to work but some care must be taken to ensure the steps are all valid; for example, in inferring
$\sqrt{n^2} = \sqrt{2n} \tag 5$
from 
$n^2 = 2n, \tag 6$
one should restrict oneself to the case $n \ge 0$, lest $\sqrt{2n}$ be undefined; but then the assertion
$n = -\sqrt 2 \sqrt n \tag 7$
at the end is inadmissible; in any event it asserts $n < 0$ which makes the presence of $\sqrt n$ erroneous.
