Notation for functions vs. numbers
A good question. There are various approaches.
Formally, in simple cases such as the ones in the question, you can get away with giving a name to the identity function $\mathrm{Id}$ which returns its argument unchanged. Then, by analogy with, say $\sin^2$, the function that squares its argument becomes $\mathrm{Id}^2$ and the function that doubles its argument is $2\,\mathrm{Id}$.
If you're really devious, you can even decide to name the identity function "$x$", and declare that everything is a function of a hidden variable with some other name. That can quickly get confusing if you have other named functions around, though. If your audience are algebraists, they will probably like this approach.
The full-featured bells-and-whistles solution, however, is to use the applied lambda calculus, in which the function that squares its argument is notated $(\lambda x.x^2)$ or $(\lambda y.y^2)$ or $(\lambda z.z^2)$ ... you get the pattern. The variable that follows the $\lambda$ is bound by the function expression and not visible outside. Thus you can write $(\lambda x.x^2)(20)=400$. The notation also allows you to write functions that take functions as arguments, such as $(\lambda f.f(42))$, or functions that return other functions, such as $(\lambda x.(\lambda y.x+y))$.
The lambda calculus is one of the bedrock formations of computer science, but not much used by contemporary mathematics -- even though it was originally invented as a possible general foundation for mathematics before computers were even invented. Mathematics sometimes uses notations such as "... the function $x \mapsto x^2$ ..." for $(\lambda x.x^2)$, but this $\mapsto$ notation is rarly used inside larger expressions.