Can I build a retaining wall on the city easement? What could happen if I do?
Most importantly, it depends on what the easement is for. In general, the owner of an easement has some specific right (for example, to cross over the property), and the owner of the property (you) retains all other rights to the property, provided they don’t unreasonably interfere with the easement holder’s rights.
So the question is, would putting a retaining wall unreasonably interfere with the city’s rights? Obviously, that depends on what those rights are.
What could happen if you are violating the easement? Well, you could be required to remove your interference, at your expense, at a minimum. Possibly also reimburse the city for the value of their lost use of the easement. Depending on your local laws, you might have to pay for their attorney fees, as well.
In short, it’s not a good idea. If you must have the retaining wall there, it’s better to get permission in advance.