# How can I specify the domain of this function?

I have a function $$f$$:

$$f:(0,\infty) \longrightarrow \mathbb R \\ x \mapsto\frac{1}{2}(e^{-x}+e^x)$$

I want to know what the domain of $$f$$ is. I know that $$f(x)=\frac{1}{2}(e^{-x}+e^x)$$ is valid for all $$x \in \mathbb R$$ so I was initially thinking that the domain is $$\mathbb R$$. However, my function only maps a subset of $$\mathbb R$$ namely $$(0, \infty)$$ to the real numbers so I wasn't sure if I need to take that into consideration when specifying the domain. I guess the more general question I asking is this:

Suppose I have a function: $$g:A \longrightarrow B \\ a \in A \mapsto g(a)=b \in B$$

Does the domain always have to be a subset of $$A$$ or can the domain have a "higher" cardinality than $$A$$.

The notation $$g\colon A\longrightarrow B$$ means (among other things) that the domain of $$g$$ is $$A$$ and not some other set.
And the cardinality of $$\mathbb R$$ is the same as that of $$(0,\infty)$$; it is not higher.
• Thank you for your answer. I just realized I made a mistake when "comparing" the cardinality. Of course the are the same. Just a follow up question on the first part of your answer. Using my example: $f(x)=\frac{1}{2}(e^x+e^{-x})$, even though $f(x)$ is valid for all $x \in \mathbb R$ the fact that it was specified that $f$ maps $(0, \infty)$ to $\mathbb R$ means that my domain is "only" $(0, \infty)$ then? – qmd Apr 27 '19 at 14:12