Let's tackle your questions separately:
Question: Visual Representation of Magic
The detect magic spell allows you to sense the presence of "magic" and shows a glow around creatures of objects that "bear magic". But what does this mean? This same question applies to the dispel magic spell and I suspect other spells.
Answer:
This part is up to your creativity and liking. Neither a more general "glow" or aura around the whole PC nor a specific "magical indication" of a specific part that is magical (e.G. one weapon is glowing) will make or break your game. I think depending on the kind of magic that is being used you could describe the magic as a light aura (cleric), dark aura (warlocks, evil guys etc), nature themes (green/brown/blue) aura (druids, rangers) and so on, if you want to give your PCs a bit more input.
Question: Spellcasting and Spellcasting Duration
Lets imagine a scenario in which a spellcaster shoots a magical ray of ice at a tree and freezes it. What is "magic" here? Is the spellcaster magic while casting it? Is the ray magic (but not a creature or object)? Is the frozen tree now magic, even if encased in mundane ice? Once the ice melts is the water magic? And if the tree has residual damage from the spell, is the tree now magic, or its damaged areas?
Answer: As a general rule of thumb I'd look at the spell's duration
- If the spell's duration is instantaneous the magic is recognizable in the moment of casting. Taking the Fireball spell as an example: During the moment of casting the wizard can be identified as using magic and maybe already the air between his hands starts to indicate a magical evocation. When the fireball is released the fire is magic fire and not normal fire, thus it is recognisable as magical. This has been confirmed indirectly by how fireball works underwater, see this sage advice podcast on underwater fighting. In short: A magical fireball does not follow the laws of physics and is distinctly different from non-magical fire. After the fireball is gone it might have caused non-magical fire that follows all laws of physics.
- If the spell has a duration and thus the effect lasts longer (as in your "ray of ice" example) the magic is recognizable for the whole duration of the spell.
Note: Regarding your example of freezing something: Which spell is that? In case you are referring to Ray of Frost following RAW you cannot freeze anything with it. I would handle Ray of Frost the same as Fireball. Regarding the spell that you described I would judge that, if it is instantaneous the ice is nonmagical or, if it has a duration, the ice is magical.
Let's dissect the last part of your question further:
I've been playing detect magic pretty loosely and it has worked fine, but sometimes I'm not sure what to highlight in the world. In these examples for example I would not highlight the defrosted damaged tree or water, but maybe I would highlight "residual signatures of magic" or the like.
"Residual signatures of magic" is a wonderful way of describing gray areas. If it is working at your table, great!
I would likely also highlight a giant cube of ice created through magic, even if it is not strictly described as magical or even described as part of a spell, but merely a consequence of it.
Following my above explanations I, personally, would not describe those as magical. If you want to highlight the "weirdness" of ice damage or something alike you could simply state that "the damage type does not match any mundane
effect that the PCs would attribute to the current environment or its inhabitants". Otherwise your PCs might feel inclined to use magic to repair or dispel the lingering magical effect.
Would starting a forest fire with produce flame mean the whole forest fire is magical? I suspect not, but I could be convinced.
You are right, it is non magical. Following RAW the spell does not allow causing damage unless used as a ranged attack which ends the spell, see Produce Flame. I'd interpret that the flame only hurts and ignites when used as a ranged attack and that effect is instantaneous (because the spell automatically ends afterwards). Following my above explanation instantaneous only triggers natural fire, not magical. If you houserule that the spell can be used to ignite materials for the whole duration I'd still rule that the flame itself is magical and causes the ignition of other materials that then burn non magically. Thus, the source of the fire was magic, but following RAW as soon as the forest caught fire the fire is nonmagical.