5^{-1} =1/5
(a)^{-1}=1/a
(0)^{-1}:=1/0 , undefined.
I think you need to be a little more careful with your parentheses. You also need to be careful which division symbol is "bigger". Do you have ((mg/kg)/day)^(-1), or do you have (mg/(kg/day))^(-1)? Or is the exponent -1 applied to something less than the entire units expression? Keep in mind that units obey certain algebraic rules: kg + kg = kg, kg/kg = 1, etc.
Overall, I'd say the best strategy is correctly to simplify your units expression into one fraction: [units]/[units]. Then pick the units you want to change, and multiply by the correct unit factor. A unit factor is like (12 in)/(1 ft)=1. You can multiply by the cleverly chosen unit factor so that the units you don't want cancel, and you're left with the units you do want. Make sense?