Yes and no. We can look at some examples: $e^3=e^x\implies 3=x$
this is true because $e^x$ is a one to one function. $2^2=x^2 \implies x=2$
is not true, because $x^2$ is not one to one.
So applying functions can change certain aspects of the equations. The original solution is still left in there somewhere, but sometimes extra solutions can pop up, or intervals that don't contain the solution won't be valid. In your example:
$\frac 1 x=5 \implies 5x=1$
is true. The solution is clearly $\frac 1 5$. However,
$\frac 1 x=0 \implies 0x=1$
clearly has no solutions (since the implication is a falsehood), and is the reason that the first equation is over $\mathbb{R}\backslash\{0\}$. What we're saying is that the equations in abstract don't always work on the same numbers, but if the solution exists in the first case, it will in the second as well.