Are operators functions? (cont.) Undergraduate here. Some time ago I had a discussion with a friend on whether or not an operator is a function. The debate centered on this issue: I believed all operators are functions, while my friend believed not all operators are functions. I acknowledge the past questions asked regarding this issue, but intend for this question to build on previous discussions.
Argument: All operators are functions
My argument that an operator is a function is this: since the input and output of an operator is a function, then it fits the definition of a function:
"A relation $f$ is a function provided $(a,b),(a,c)\in f$ implies $b=c$."
In addition, the majority of online resources claim that operators are functions: On Quora, answers state that the operator is either "a special type of function" or exactly a function. In StackExchange, here, and here, the operator is also "a special kind of function," etc. Wikipedia states that an operator is a mapping, and since mappings are functions, operators are therefore functions. (I'll note that the reliability of Wikipedia is debated and questioned here.)
On my conceptual interpretation of the operator and the literature surrounding it, I came to support the argument that all operators are functions.
Argument: Not all operators are functions
My friend argued that there exist operators that do not conform to the definition of the function. He lists these operators as examples:


*

*The indefinite integral operator $\int$, in which $\int dt(f(t))=F(t)+C$ an arbitrary constant $C$.

*A square root operator $S$, where $S(f)=\pm\sqrt f$.

*A less-than operator $T$, where $T(f)=g$ for all $g<f$.

*A random number generator $U$, where $U(f)=x$ for some random number $x$.


Since for any of these functions, the input of a function can correspond to an output of two or more distinct functions, it follows that not all operators are functions. We agreed that if all operators are functions, then the indefinite integral operator and co. are not operators.
However, I also couldn’t ignore the literature online. I consulted with two professors. One suggested a correction on the indefinite integral, and it return an equivalence class of functions, instead of multiple distinct functions, for some function input, so technically there is one output. Although this argument fits the integral operator as a function, it seems to contradict the definition given by Wikipedia, where domain and codomain are the same. The other said that the definition of an operator depends on the math field we are working in.
Our (frankly enjoyable) debate thus stopped without conclusion, but I believed that progress would be made if we were given a rigorous (and preferably, widely accepted) definition of an operator, instead of working with what we think what an operator is. Thank you for reading, and my key questions are below:


*

*How are operators defined? If definitions vary depending on field, please give a working definition in your field.

*Are operators functions? Depending on the definition, this answer may differ. If operators are not functions, please give some counterexample.


(Some extra context: we both were in Intro to Quantum and read Gasiorowicz, and where I was first exposed to the idea of operators and operator manipulations such as $(\frac{d}{dx})^2=\frac{d^2}{dx^2}$. I thought if I really understand what an operator is, then this type of manipulation would be intuitive and founded. I also understand that there exists a relation between operators and transformations.)
 A: I'm leaning towards the side of "functions", with some linguistic/philosophical caveats related to clearing up what exactly you and your friend were discussing/interested in knowing.
Operators act like functions...
I claim that anything you can do with an operator, you can do with a function, so that it comes down to whether an definition based on how to compute with them suffices*. If your friend agrees with me but says something "sure, I grant that every operator has an associated function that can do the same things, but they're not operators themselves", then I can't take sides without hearing their definition of "operator".
*(This could be considered an operational definition if you think about what the operators do or a theoretical definition since it's not about the way people use the word "operator".)
To this end, I'll try and challenge the examples your friend gave, one-by-one:
Integral
There are a few different ways you could interpret the indefinite integral operator. In one interpretation, it could be a function from, say, "the set $C(I)$ of continuous functions from an open interval $I$ to $\mathbb R$" to "the power set of $C(I)$" (sometimes denoted $\wp\left(C(I)\right)$) that sends a function $f$ to the set of functions $F$ defined on the same interval $I$ such that $F'=f$.
If we'd like the integral to have domain and codomain both being just a set of functions like $C(I)$, then the standard "indefinite integral" is a bit of an odd case simply because we don't usually care exactly which function we get. Basically, for each value of $a$, $f\mapsto g(x)={\displaystyle \int_a^x}f(t)\,\mathrm dt$ is an integral operator that's good enough, and as a sort of abuse of notation we bundle up the options together under the umbrella of the indefinite integral.
Square Root
I don't think it's really common to call this thing an operator, but we can certainly have a function from $\mathbb R$ or $\mathbb C$ to the power set of the same that outputs the set of all possible "square roots". I.e. given by $s(x)=\{y\mid y^2=x\}$. In this case, $s(4)=\{2,-2\}$, etc.
Less-than operator
I've definitely never heard of this operator, but we could still certainly have functions like $T:\mathbb R\to\wp(\mathbb R)$ given by $T(x)=\{y\mid y<x\}$.
There may be some confusion with the fact that in computer programming, we might refer to a different "less-than operator", whose function meaning is usually given by something like $L(x,y)=\begin{cases}\text{True}&\text{ if }x<y\\\text{False}&\text{ otherwise}\end{cases}$
Random-Number Generator
This is subtle, because I think the vast majority of mathematicians would not call that an operator, but in some programming contexts, the word "operator" pops up in related code (example). "Functions" in imperative programming languages aren't really like functions in math, but I would still say that a pseudorandom number generator at some level acts like a function (with suitably computerized domain and codomain) $U:\mathbb Z\to \mathbb [0,1]\times \mathbb Z$ where $U$ takes a current seed/state as input, and outputs a random number and a new seed/state.

...But there are two words for a reason
Operators can have different syntax
In contexts where "functions" need parentheses around their arguments, operators don't (e.g. $Df$ for the derivative of $f$). Or in the case of (partial) indefinite integrals, arguments get special notation: $\int f(x,y)\,\mathrm dx$ has the "variable of integration" argument after a special symbol $\mathrm d$. Or in the case of definite integrals or summation, the arguments get special placements: we write ${\displaystyle \sum_{i=1}^5} i^2$ instead of something like $\sum(i,1,5,i^2)$.
So you could say "some operators aren't functions because you can't write functions in weird ways like that". This is very similar to the question "Are infinite sequences just functions with domain the positive integers or not?". If the notation is part of what's under discussion, then they're not functions.
"Operator" is used in special contexts
Even restricting ourselves to cases/books where operators and other functions may look the same in symbols, just like there aren't really absolute synonyms, usage of the word "operator" isn't interchangeable with that of "function".
There are a variety of special implications/uses/contexts, and this won't be a comprehensive list, but some are:

*

*An operator is a linear map/function/transformation where the domain and codomain are the same vector space. (Sources: MIT OCW Quantum Physics II notes, Rudin)

*This is rarer, but some authors might generalize the above and speak of "linear operators" between two different spaces, or even call affine transformations "operators", as in page 7 of "Application of Distributions to the Theory of Elementary Particles in Quantum Mechanics", this MSE question, and these recent slides on "Affine computation and affine automation"

*An operator is something (often linear) that takes common functions (often $\mathbb R^n\to\mathbb R^m$ or $\mathbb C^n\to\mathbb C^m$) to other common functions, like differential operators (including things like the gradient), pseudo-differential operators, Schwarzian derivative (which is not linear, so this isn't a case of the first definition), integral transforms, and differintegral operators. In a context like this, "function" would be restricted to the things the operators can take as inputs, and the operators wouldn't be called "functions".

*As mentioned before, "operator" is used in programming to mean something very much like "a (built-in) function but with a special syntax".

So something called an "operator" in mathematics is essentially always something analogous to a linear transformation from a vector space to itself, with things like the Schwarzian derivative and a couple of exceptional generalizations pushing on that boundary a bit.
What's the verdict?
It depends what sort of meaning of "operators are functions" you both had in mind. In terms of inputs and outputs, they are all still functions. But in terms of usage and notation, they can act differently than arbitrary functions, and in many contexts would not be called "functions".
A: The word "operator" is used with at least two different meanings in mathematics:


*

*In functional analysis, "operator" is more or less a synonym for linear transformation between two abstract vector spaces.
It seems that people talk about "operators" instead of "transformations" more often when the vector spaces in question are fancier or "richer" than the familiar $\mathbb R^n$, particularly if they are imagined to be infinite-dimensional, and/or when topology plays a nontrivial role in what you're doing -- but this is just a tendency and not something that one can rely hard on.
In this sense of "operator", an operator certainly is a function.

*However, "operator" can also simply mean a symbol that one uses to build mathematical expressions from simpler expressions.
I suspect this usage may only be common in areas with connections to computer science (where it is very common when discussing programming languages) -- but on the other hand CS must have gotten it from somewhere, so I think it is originally an indigenous mathematical word.
In this sense, there is no strong requirement that and "operator" stands for a particular function. It often will, if only because expressions that are not single-valued are generally frowned upon. But as your friend's examples show, there are areas where having multi-valued expressions is so convenient that we have them anyway, and the symbols we use to write those with can often be called operators as well.
It wouldn't surprise me if there are additional possible meanings that I've forgotten here.
