Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
$\begingroup$A fuller example would be helpful, as there is more than one kind of function in Mathematica. For instance, if you are writing the function yourself, you could simply type it yourself: f[x_] := (Print["My name is ", f]; x^2)$\endgroup$
$\begingroup$@tombom21 while answers in the linked topic suggest 'not without trickery' I believe it is a duplicate. Let me know if you disagree.$\endgroup$
Stack
maybe. $\endgroup$f[x_] := (Print["My name is ", f]; x^2)
$\endgroup$call : f[x_] := (Print["Hi! You called ", HoldForm[call]]; x^2)
and thenf[4]
. $\endgroup$