Define the new function type in the preamble instead of in the algorithm
environment. Since the algorithm
environment is a floating object, it will sometimes end up after the text using the command, and since the use of the command precedes its definition, the command will be undefined.
\documentclass{report}
\usepackage{algorithm2e}
\SetKwFunction{default}{default}
\begin{document}
\begin{algorithm}
\default($ a $).
\end{algorithm}
\default always works, no matter whether this part is typeset before or after the algorithm.
\end{document}
If you just want to replicate the style of certain elements in the algorithm, it might be easier to use the corresponding style definitions.

\documentclass{article}
\usepackage{algorithm2e}
\advance\textwidth1.5cm
\begin{document}
To use the same style for program elements outside of the
\texttt{algorithm} environment of the package \texttt{algorithm2e},
use the following commands.
\begin{center}
\begin{tabular}{llll}
element type & command & \multicolumn{2}{c}{example} \\
\hline
keywords & \verb"\KwSty" & \verb"\KwSty{else}" & \KwSty{else} \\
arguments & \verb"\ArgSty" & \verb"\ArgSty{arg}" & \ArgSty{arg} \\
function args & \verb"\FuncArgSty" & \verb"\FuncArgSty{farg}" & \FuncArgSty{farg} \\
function names & \verb"\FuncSty" & \verb"\FuncSty{fnc}" & \FuncSty{fnc} \\
program names & \verb"\ProgSty" & \verb"\ProgSty{prg}" & \ProgSty{prg} \\
data & \verb"\DataSty" & \verb"\DataSty{data}" & \DataSty{data} \\
comments & \verb"\CommentSty" & \verb"\CommentSty{comment}" & \CommentSty{comment} \\
titles & \verb"\TitleSty" & \verb"\TitleSty{title}" & \TitleSty{title} \\
block markers & \verb"\BlockMarkersSty" & \verb"\BlockMarkersSty{newblock}" & \BlockMarkersSty{newblock}
\end{tabular}
\end{center}
\end{document}