Zero divisors in ring of real valued functions.
Yes, that's a fine argument. For a slightly different approach, note that if $f$ has no zeros, then we can define an inverse for it via
$$\tilde{f}(x) = \frac{1}{f(x)}$$
Since $f(x) \ne 0$ for all $x$, this makes sense. Then it's easy to check that $f \tilde f = 1 = \tilde f f$ is the function which is identically $1$ (which is the multiplicative identity in the ring), so that $f$ is invertible as a ring element. Invertible elements are never zero divisors.
If you're not assuming continuity, then the zero divisors are precisely the functions that vanish somewhere. If you have a function $f$ that vanishes somewhere, say at $x$, then you can define a function $g$ that takes the value 1 at $x$, and 0 everywhere else. Then $fg = 0$, but neither $f,g$ are 0.
Edit: I just want to add that sometimes in math instead of trying to directly prove it, you can try to work intuitively, for example, think about what kinds of zero divisors you can come up with. Ie, try to come up with two nonzero functions that multiply to 0. For example, you could have the function $f(x) = x$, $g(x) = x^2-1$, then $(fg)(x) = x(x^2-1)$, which is obviously not the zero function. So that doesn't work. Maybe you can come up with some other examples, and see which work, which don't...etc.