How do we know that we found all solutions of a differential equation?
Solution 1:
When you study the topic in University, you will probably encounter uniqueness theorems that show that for certain ODE's, not only does a solution exist, but this solution is also unique - there are no other solutions.
For first order ODE's such as that in your example, the relevant theorem is the Picard–Lindelöf theorem, which shows that your solution is indeed unique around a given interval. These intervals can then be strung together to show this is the only solution across the entire domain.
I'll add that for some other forms of differential equations it is not at all clear that solutions are unique. The most famous example is probably the Navier-Stokes equations in three dimensions, which govern the motion of gases and liquids all around us, and yet no proof of uniqueness in all cases is known.
Solution 2:
For any solution $y$ to that equation, the following holds.
$y e^{-x} - y'(x) e^{-x} = (y(x)-y'(x))e^{-x} = 0$ for any $x \in \mathbb{R}$.
Thus $\frac{d}{dx}(y(x)e^{-x}) = 0$ for any $x \in \mathbb{R}$.
Thus $y(x)e^{-x} = c$ for any $x \in \mathbb{R}$, for some constant $c \in \mathbb{R}$ [by mean value theorem].
Note that this includes even the case of $c = 0$, and also does not face division by zero, unlike the typical method taught in high-school.
Solution 3:
You expressed a special case. I respond to you by that case:
If $$y'=y$$
it means that
$$\frac{y'}{y}-1=0$$
Then we integrate of both sides:
$$ln(y)-x=C$$
Can integration of zero have any result other than a constant number? If cannot, then that include the whole answers.