For showing how you solved a problem, is it correct to use the same variable to refer to values both without units and with units? such as:
Q: A farmer wishes to build a fence ... Find the area if 240 meters of fencing are available.
A:
$$ l = \mathrm{length} $$ $$ w = \mathrm{width} $$ $$ ... $$ $$ l = 120 $$ $$ w = 60 $$ $$ A = 120 \times 60 $$ $$ = 7200 \space \mathrm{m^2} $$
Or would you need to name things differently like this:
$$ l = \mathrm{length \space in \space meters} $$ $$ w = \mathrm{width \space in \space meters} $$ $$ ... $$ $$ l = 120 $$ $$ w = 60 $$ $$ A = 120 \times 60 $$ $$ \mathrm{Area} = 7200 \space \mathrm{m^2} $$
For the first style, I have a high school text book which uses it, and so does a math professor: http://web.cs.ucdavis.edu/~amenta/w10/writingman.pdf (p12) but it has the problem that it says $7200 = 7200 \space \mathrm{m^2}$ which I think is technically not true. How can they justify this use of an equals sign for apparently unequal things?
For the second style, it's consistent with how units are used in physics and asked here: https://physics.stackexchange.com/questions/138841/should-i-always-include-units-at-every-step
Clarification: I'm trying to find out if and how the first style is correct, not recommendations for alternative styles such as leaving numbers until the very end or including units all the way through.
It's really useful to keep the dimensions with you along the way, because they provide a check that your answer is in the correct dimensions. If you use some measure wrongly, your units will often tell you - like a parity bit in data transmission. For that reason, I would recommend to always do so.
Technically, the calculation you are making is in units, so it is also correct to retain the units. BUT mathematics is an abstraction of reality, and you could equally argue that you are calculating the abstract, numerical value of the answer and that the units are implicit. So you have a case for removing them but it is disadvantageous to do so for the above reason, so I would keep them at all times.