I thought I dod for plots, but it looks like you assign values for plots. I like the graph, but the big thing is to show that since f(x) is continuous, there is value for every point, even irrationals, like sqrt(1000)
Package LaTeXStrings allows for a modifier (L) placed in front of strings ("..."), e.g., L"...", which inserts some \LaTeX code and makes it simpler to construct strings with math. So I can write L"f(\cdot)" which the LaTeXStrings package changes to the appropriate string of \LaTeX code.
To appreciate LaTeXStrings, you need to find a book on \LaTeX/\TeX math, and study the documentation of LaTeXStrings.
LaTeXStrings is not perfect, essentially because \LaTeX uses symbol $ to bracket math, while $ is simultaneously used in Julia as “interpolator” in text strings. I don’t have any perfect solution to this, though.
You want the function nameof giving the name of a function
julia> function g(x)
x + 1
g (generic function with 1 method)
julia> function myplot(fun, x)
plot(fun.(x), label = string(nameof(fun)))
myplot (generic function with 1 method)
julia> x = [1, 2, 3];
julia> myplot(g, x)