Rather than expressing it as a minimization problem, you want to find the root (zero) of
x -> f(x)-y
Example
using Roots
f(x) = x^2
finv(y) = fzero(x->f(x) - y, 1) # set initial guess here
finv(2)
julia> finv(2)
1.41421
Rather than expressing it as a minimization problem, you want to find the root (zero) of
x -> f(x)-y
Example
using Roots
f(x) = x^2
finv(y) = fzero(x->f(x) - y, 1) # set initial guess here
finv(2)
julia> finv(2)
1.41421