Is there such a function: $f = \{0 \text{ when } x=0, 1 \text{ when } x ≠0 \}$? I'm looking for a simple function defined as:
$$
f(x) = \begin{cases}

 0, & \text{ when } x = 0,
\\ C, & \text{ when }x \neq 0.
\end{cases}
$$
Basically, I only want the constant to matter if $x \neq 0$.
 A: Yes, there certainly is such a function! The notion that a function has to be defined by some sort of 'formula' is thoroughly out of date -- you can define a function to be anything you like, as long as it has an unambiguous value for each of its arguments.  
You forgot to specify what the possible arguments of this function are, so -- to be complete -- you need to do that. Do you want your function to be defined on the set of real numbers? Then you should say so.
A: You had just defined it :-)
What about $f(x) = C \cdot \mathrm{sign}(|x|)$?
A: You can define your function $f: \Bbb R \longrightarrow \{0, 1\}$ as follows: $f(0) = 0$ and $f(x) = 1$ for $x \neq 0$.
A: You can write it as $C\cdot(1-\delta_0)$ where $\delta_0(x)=1$ if $x=0$ and otherwise $\delta_0(x)=0$.
Generally speaking, though, functions do not need to be defined by a formula. Most functions, in fact, cannot be defined by formulas. Function is some sort of a machine which is designed to result in a particular output when entered a particular input. What's inside? Magic!
