Let's say I have a neural network $f$ that takes input $\vec x \in \mathbb {R}^n$ and produces output $f(\vec x) \in \mathbb{R}$.
How can I find $\hat x = \underset{\vec x}{\arg\max} \; f(\vec x)$?
You would have to do it in the same way you train it: numerical optimisation.
This comes down to applying backprop but having a loss function of the negative output and not changing the weights, but adapting the input. You would have to change your neural net software in a way that you also get the deltas at the input layer.