To solve an equation like this:
$x^2+x=0$
We can take $x$ as a common factor
$\frac{x^2}{x}+\frac{x}{x}=0$
$x(x+1)=0$
However to do such a step we have to say that $x$ isn't equal to zero, because after all, if $x$ is equal to zero, then $\frac{x}{x} \neq1$, like we factorized. Instead our factorization should look like this:
$x(∞)=0$
And even though we stated clearly that $x$ can't be equal to zero above, later on to get the solutions we state:
$x=-1$ $or$ $x=0$
I know this is a very silly question and that's why I didn't want to ask my teacher about it. And I totally get that it doesn't matter in this equation anyway.
But shouldn't this be considered wrong, to state that $x$ shouldn't be a certain value to reach a certain step then when we are over that step and we reach another step we say that $x$ is that certain value we based our work on the fact that it shouldn't be it.
There are two ways to solve your equation. First, we could deal with the cases separately. If $x \neq 0$, then we can safely divide by $x$, meaning that $$ x^2+x=0 $$ implies $$ x+1=0 $$ which in turn implies that $x=-1$. Then, we have to deal with the case that $x=0$. This is also a solution to your equation—we can verify this by plugging it in.
There is a second, more elegant way of solving the equation, that you yourself have alluded to. If $x^2+x=0$, then $$ x(x+1)=0 \, , $$ which implies $x=0$ or $x=1$. Note that there is no division by $x$ here at all. Finally, you appear to suggest at one point in your question that $0/0 = \infty$. This is not true. In fact, $0/0$ is undefined. It is as meaningless to talk about $0/0$ as it is to talk about $\text{yellow}/\text{blue}$.