We provide two characterizations of optimal trajectories for the classical Meyer problem arising in optimal control. The first one uses the optimal feedback map, while the second is a viability statement. We also investigate regularity of directional derivatives of the corresponding value function and apply the obtained results to study regularity of the map of optimal feedback.