At face value, something like that should be enough to make a proof by contradiction. However, if this is some sort of introductory mathematics class you are following where you are discussing stuff like axioms, it could be that you would need to add more onto that proof.
As you may know, the field of Real Numbers (and any other field) has 6 axioms:
- Closure
- Multiplicative + Additive Identity
- Multiplicative + Additive Inverse
- Commutativity
- Associativity
- Distributivity
So if you are strictly using axioms, you would also have to prove that:
• Anything times 0 remains zero (I am sure you can arrive at that using axioms)
And
• Either the additive or the multiplicative identity is unique (then you can for sure logically say that 0=1 is absurd).
For this one, you can go by contradiction too:
Suppose for contradiction that the additive inverse is NOT unique. In other words, there exists a certain $y,z$, where $y≠z$ such that $$x+y=0=x+z$$ Hence,
$$x+y=x+z$$
Adding y to both sides, we get
$$y + (x+y) = y + (x+z) $$
$$(y+x) + y = (y+x) + z$$
And since $$y+x = 0$$ Then
$$0 + y = 0 + z$$
$$y=z$$
Which contradicts our initial statement that $y≠z$. Therefore, the additive identity is unique. So 0 is unique, and 0=1 is impossible as 0 is a unique value.
Therefore, that also means that your theorem holds true, i.e. If $ab=0$, then $a=0 $ and/or $b=0$.
Honestly I don't think you need to go this much in depth if you are proving something like that. But sometimes it is important that in maths we go to the very fundamentals in order to submit a 100% correct proof even if it's as trivial as this one!