What ring operations do you want to use? If it's pointwise addition and multiplication, then you want a ring structure on the range--a metric space doesn't necessarily support that. If the range has no zero divisors, then what you need to worry about is two nonzero functions whose zero-sets unioned together are the whole domain.