Jose Manuel Moreno Ramos
1) Can you withdraw forward when attacked from rear? (Cohort Equites)
In this case as there isn't any other way to flee, it is possible to withdraw forward until the unit can withdraw towards its lines.
2) general questions: what if sides of board would be opposite, can you withdraw towards enemy starting positions?
In general you have to try to withdraw towards your own starting position not towards enemy ones. In this case as the unit is attacked by its rearguard it can't retreat towards its lines.
3) How can you maintain position / contact without turning (Punic Cavalry)
You can't do it. The unit has to be frontally in contact to try to keep contact.
4) general questions: can you withdraw just to get in contact with other unit this turn and attack in melee?
No, you can't enter in contact with an enemy unit. So in the case of the picture, if the fleeing unit may enter in contact with the other enemy unit, it can't withdraw in that direction.