We present a method for approximating a single-variable function \(f\) using persistence diagrams of sublevel sets of \(f\) from height functions in different directions. We provide algorithms for both the piecewise linear and smooth settings. Three directions suffice to locate all local maxima and minima of a piecewise linear continuous function from its collection of directional persistence diagrams, whereas at least five directions are necessary to approximate non-degenerate critical points of smooth functions. This framework for reconstructing functions by means of persistence diagrams is motivated by a study of importance attribution in machine learning, whose goal is to reduce the number of critical points of signals without a significant loss of information for neural network classification tasks.