If I have the function $f:\{0,1\}\rightarrow\mathbb R$, I know this could mean $f(0)=12$ or $f(1)=32$, etc. etc.
But, can we also have a function on the following form: $$ g:\mathbb R \rightarrow\{0,1\} \qquad ? $$ For example $g(2.43)=1$?
And also, can we have $$ h:\mathbb R^2\rightarrow \{0,1\} \qquad ? $$ For example, $h(3,4.79)=1$?
Can we also have higher-order, say $n$, so $$ h_2:\mathbb R^n \rightarrow \{0,1\} \qquad ? $$
Please post examples if you have any, thanks!

You are right. If $A$ and $B$ are sets, and $f$ is a function from $A$ to $B$, we usually write $$\begin{align} f: A &\longrightarrow B \\ a & \longmapsto b \end{align}$$ or $f:A\to B$ defined by $f(a)=b$, where $a$ is refered to be an element of $A$ and $b$, which is $f(a)$, an element of $B$.