If I am permanently turned into an ancient brass dragon with true polymorph and then use the Change Shape trait to become a humanoid again, can I buy new weapons and use them? Can I use my class abilities and my spells like before?
Change Shape states that:
In a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.
You keep the proficiencies of the dragon. You gain all other statistics not listed except class features.
Can I can buy new weapons and use them?
You can buy new weapons and use them, but you will not have proficiency in them since a dragon doesn't have weapon proficiencies.
Can I use my class abilities and my spells like before?
Unfortunately class abilities, spells known, and spellcasting are all class features, so you won't be able to use them.