  In this work we extend the characterization of semimartingale functions in
Cinlar et al. (1980) to the non-Markovian setting. We prove that if a function
of a semimartingale remains a semimartingale, then under certain conditions the
function must have intervals where it is a difference of two convex functions.
Under suitable conditions this property also holds for random functions. As an
application, we prove that the median process defined in Prokaj et al. (2011)
is not a semimartingale. The same process appears also in Hu and Warren (2000)
where the question of the semimartingale property is raised but not settled.
