Example of Dual Category That Makes No Sense (to me)
No, we don't use "the analogous function" (e.g. "Take the negative square root") - we use literally the same function.
The morphism from $B$ to $A$ in the category $C^{op}$ is the function $$f: A\rightarrow B: a\mapsto-\sqrt{b}.$$ It doesn't matter that this is a function from $A$ to $B$, and not from $B$ to $A$; a morphism from one object to another does not in any way have to be a function from the underlying set of the first to the underlying set of the second (nor, in fact, do objects need to have underlying sets in the first place).
For a "bigger" but less ad-hoc example, that might be easier to think about: in the category Set$^{op}$, a morphism from $A$ to $B$ is a function in the usual sense from $B$ to $A$.
More natural, but more technical, examples include the homotopy category and the cobordism category.
It might be helpful at this point to consider a purely algebraic description of a category.
First, remember what (say) a group is: it's a set $G$ together with a binary operation $*$ on $G$, with some properties. It doesn't matter what the elements of $G$ are, and in fact we never talk about this - only the structure relating them is relevant.
OK, so along these lines, here's how to think about a category. First, let's ditch the objects for simplicity: we don't actually need them (objects can be conflated with their identity morphisms). A category, for us, is going to be a set $C$ (the set of morphisms) together with a partial (= not always defined) binary operation $*$ (composition), with the following properties:
Associativity: If $(a*b)*c$ is defined, then so is $a*(b*c)$, and they are equal; and if $a*(b*c)$ is defined, then so is $(a*b)*c$, and they are equal.
"Source" identities: For any $a$, there is a unique $e$ such that
$a*e$ is defined ($e$ is a morphism to the source of $a$).
$e*e$ is defined ($e$'s source and target are the same).
For all $b$, if $b*e$ is defined then $b*e=b$; and if $e*b$ is defined then $e*b=b$ ($e$ acts like an identity morphism).
"Target" identities: the same as the above, but the first bullet says instead "$e*a$ is defined."
Note that this is purely algebraic, and we don't need to give any meaning to the elements of the set $C$.
Besides building intuition, this is a very fruitful idea: for example, it lets us define a group as a one-object category where every morphism has an inverse! If you unwind the picture above, you'll see that this means exactly that "$*$" is defined everywhere (since there's only one object), so there is only one identity morphism $e$, and associativity and inverses mean that this is just a group! This way of thinking of classical algebraic structures as categories with certain properties is incredibly fruitful, and leads to a number of useful generalizations; for instance, it motivates the definition of a groupoid as a group but with multiple objects, which in turn lets us define fundamental groupoids which are often better to work with than fundamental groups.
Let $\mathscr{C}$ be a category. The opposite category of $\mathscr{C}$ is the category $\mathscr{C}^{\mathrm{op}}$ where
$\DeclareMathOperator{Ob}{Ob}\DeclareMathOperator{id}{id}\Ob(\mathscr{C}^{\mathrm{op}})=\Ob(\mathscr{C})$
$\DeclareMathOperator{Hom}{Hom}\Hom_{\mathscr{C}^{\mathrm{op}}}(X, Y)=\Hom_{\mathscr{C}}(Y,X)$
That is, $\mathscr{C}^{\mathrm{op}}$ has the same objects as $\mathscr{C}$ and the same morphisms as $\mathscr{C}$. The statement "$f$ is a morphism $X\to Y$ in $\mathscr{C}^{\mathrm{op}}$" is the same statement as "$f$ is a morphism $Y\to X$ in $\mathscr{C}$."
For example, consider $\mathscr{C}=\mathsf{Set}$. Here, we have a function $f\in\Hom_{\mathsf{Set}}(\Bbb R^+,\Bbb R)$ given by $f(x)=\log(x)$. The function $f$ is also a morphism in $\mathsf{Set}^{\mathrm{op}}$, except now $f\in\Hom_{\mathsf{Set}^{\mathrm{op}}}(\Bbb R,\Bbb R^+)$ since $\Hom_{\mathsf{Set}^{\mathrm{op}}}(\Bbb R,\Bbb R^+)=\Hom_{\mathsf{Set}}(\Bbb R^+,\Bbb R)$.
In short, declaring that $f:X\to Y$ in $\mathsf{Set}^{\mathrm{op}}$ is to declare that $f$ is a map of sets with domain $Y$ and target $X$.
In your example, we have a category $\mathscr{C}$ where $\Ob(\mathscr{C})=\{\Bbb R^+,\Bbb R^-\}$ and we are told that one morphism $f\in\Hom_{\mathscr{C}}(\Bbb R^+,\Bbb R^-)$ is the map of sets $f:\Bbb R^+\to\Bbb R^-$ given by the formula $f(x)=-\sqrt{x}$.
The opposite category $\mathscr{C}^{\mathrm{op}}$ also contains this morphism except now $f\in\Hom_{\mathscr{C}^{\mathrm{op}}}(\Bbb R^-,\Bbb R^+)$.
It is possible that this $f$ is the only nontrivial morphism in $\mathscr{C}$, in which case we have an explicit description of $\mathscr{C}$: \begin{align*} \Ob(\mathscr{C}) &= \{\Bbb R^+, \Bbb R^-\} & \Hom_{\mathscr{C}}(\Bbb R^+,\Bbb R^+) &= \{\id_{\Bbb R^+}\} & \Hom_{\mathscr{C}}(\Bbb R^-, \Bbb R^-) &= \{\id_{\Bbb R^-}\} \\ && \Hom_{\mathscr{C}}(\Bbb R^+,\Bbb R^-)&=\{f\} & \Hom_{\mathscr{C}}(\Bbb R^-,\Bbb R^+) &=\varnothing \end{align*} This gives the explicit description of $\mathscr{C}^{\mathrm{op}}$: \begin{align*} \Ob(\mathscr{C^{\mathrm{op}}}) &= \{\Bbb R^+, \Bbb R^-\} & \Hom_{\mathscr{C^{\mathrm{op}}}}(\Bbb R^+,\Bbb R^+) &= \{\id_{\Bbb R^+}\} & \Hom_{\mathscr{C^{\mathrm{op}}}}(\Bbb R^-, \Bbb R^-) &= \{\id_{\Bbb R^-}\} \\ && \Hom_{\mathscr{C^{\mathrm{op}}}}(\Bbb R^+,\Bbb R^-)&=\varnothing & \Hom_{\mathscr{C^{\mathrm{op}}}}(\Bbb R^-,\Bbb R^+) &=\{f\} \end{align*} Note that here $\id_{\Bbb R^{\pm}}$ need not be a map of sets!