I am recently writing a piece for violin and piano. Should I write the f and p dynamic markings of the violin above the stave of violin or below?
Also, should tempo markings such as rit. written on both violin and piano?
Dynamics for violin should go underneath the staff. Dynamics for Piano should be centered inside the grand staff unless you have specific requirements for each hand. Which, depending on context, can be put outside. Only vocalists need dynamics above the staff.
Tempo markings should go on top, in this case, on top of the violin part.
Dynamic markings should always go below (unless if there's multiple voices on one staff and you want to have different dynamics for each voice)
Tempo markings always apply to the whole system, i.e. they go above the highest staff (normally the piano in this case)