Characteristics-Informed Neural Networks for Forward and Inverse Hyperbolic Problems