Answer
$$f(x)=x$$
Work Step by Step
If $g(x)$ is considered a (constant function) along with $g(x)=k$ with $k$ being the constant, then the following would be considered the following: $$f(g(x))=f(k)$$
Since $g(x)$ is the constant function, then it already notes that $$g(f(x))=k$$
So, since both
$$\begin{matrix}
f(g(x))=f(k)& and &g(f(x))=k
\end{matrix}$$
then it comes to the following:
$$\begin{matrix}
f(g(x))=g(f(x))\\ and\\ f(k)=k
\end{matrix}$$
The previous is thanks to using both $f(g(x))$'s and $g(f(x))$'s values while it helps us figure out the last two parts that were stated.
Finally, this would note that $\mathbb{R}$, or "all real numbers", while noting that $k$ is for all real numbers, which would mean the following: $$f(x)=x$$
Therefore, $f(x)$ is actually going to the straight line for the graph of $f(x)=x$.