Finding the Inverse of Constant Function
A constant function has the general form [latex]f\left( x \right) = {\color{red}a}[/latex] where [latex]\color{red}a[/latex] is a real number.
From the general formula, the output of a constant function regardless of its input value (usually denoted by [latex]x[/latex]), will always be the same which is the fixed number [latex]\color{red}a[/latex].
How to Find the Inverse of a Constant Function
Suppose we have a constant function [latex]f\left( x \right) = 2[/latex]. The graph of this function is just a horizontal line (parallel to the [latex]x[/latex]-axis) passing through the point [latex]\color{blue}(0, 2)[/latex].

Now, we can find its inverse algebraically by doing the following steps:
- Given:
[latex]f\left( x \right) = 2[/latex]
- Replace [latex]f\left( x \right)[/latex] by [latex]y[/latex].
[latex]y = 2[/latex]
- Swap the roles of [latex]x[/latex] and [latex]y[/latex] to get the inverse function:
[latex]x=2[/latex]
The graph of [latex]\color{red}x=2[/latex] is just a vertical line (parallel to the [latex]y[/latex]-axis) passing through the point [latex](2, 0)[/latex]. Here are the graphs of the original constant function and its inverse on the same [latex]XY[/latex]-axis,

They are truly inverses of each other because they are symmetrical about the line [latex]\large{\color{green}y=x}[/latex]. Observe that their graphs are mirror images of each other along that line.

However, is the vertical line [latex]x=2[/latex] a function? The answer is NO. Since every vertical line would fail the vertical line test. If we draw a vertical line cutting through [latex]x=2[/latex] it will intersect at it more than once. In fact, they will overlap thus intersecting at an infinite number of points.
So in summary, the inverse of any constant function will always be a vertical line which is not a function. Therefore, every constant function has no inverse that is a function!
You may also be interested in these related math lessons or tutorials:
Inverse of Absolute Value Function
Inverse of Exponential Function