$f(x) = 0$ when $x$ is $0$, and $1$ otherwise I've been trying to create a function that will return $0$ when $x$ is $0$, and for any other $x$ value it should return $1$. I've searched for a pre-existing function online too and wasn't able to find one.
Do you know of any function that can do this?
 A: How about $f(x)=\left\lceil\frac{x^2}{x^2+1}\right\rceil$
*Works for real numbers, with imaginary numbers you may divide by 0.
A: How about $f(x)= 1-\delta_{x,0}$ (using the Kronecker Delta function, in Mathematica/WolframAlpha can write the $\delta_{x,0}$ as 

kroneckerdelta(x,0)

)
A: Here's one using $\sum$ notation although it only works for the natural numbers:
$f(x) = \sum\limits_{i = 1}^{x}{\frac{1}{x}} $
Due to the empty sum being 0.
It can't be simplified to $f(x) = x \times \frac{1}{x}$ because then f(0) would be undefined. 
A: You've already defined your function (assuming you've also chosen its domain).
One of the main ways to "create" a function is simply by specifying its values at all points, and your description has done so.
Typical notation for a function created by the sort of description you give is a definition by cases:
$$ f(x) := \begin{cases} 0 & x = 0 \\ 1 & x \neq 0 \end{cases} $$
For many applications — most applications, I expect — this is one of the best descriptions of said function. If need be, name it with a letter, and continue on with whatever you're doing.

The complementary function
$$ g(x) := \begin{cases} 1 & x = 0 \\ 0 & x \neq 0 \end{cases} $$
which is related to your function by $f(x) = 1 - g(x)$ comes up often enough in some contexts to have been given a name and notation: e.g.


*

*The Kronecker delta. A few different notations exist depending on the setting; e.g. $\delta_x$, $\delta[x]$, or $\delta_{x,0}$.

*The Iverson bracket. This would be notated $[x = 0]$. This notation is, IMO, indispensable for doing complicated calculations with summations.

*x == 0 computes this function in C and C++, and many other programming languages allow similar.



Some applications might want to represent such a function in particular ways. For example, if one only cares about the value of $g(x)$ when $x$ is an integer, but strongly prefers to work with analytic functions (e.g. because you're studying a sequence using complex analysis), one has the fact that
$$ g(x) = \mathop{\mathrm{sinc}}(\pi x) $$
holds whenever $x$ is an integer.
(if you're unfamiliar with it, $\mathop{\mathrm{sinc}}(z)$ is the continuous extension of $\sin(z) / z$)
A: You can use the fact that $0^0$ is equal to $1$ and $0$ raised to any other positive power is $0$ itself.
So, the function would be:$$f(x)=1-0^{|x|}$$
When x is $0$, $1-0^x = 1-0^0 = 1-1 = 0$ while for any other positive or negative number it would evaluate to $1-0 = 1$.
Hope this helps!
A: Paw88789's answer worked great for what I'm trying to do; the only issue was that it didn't work for all "numbers"; some imaginary numbers would cause division by 0. Luckily tonight I was able to create a function that produced the desired result extended to the range of numbers I need to work with
$f(x) = \left \lceil \frac{1}{2\Gamma \left ( \left | x \right | \right )} \right \rceil$
*Note the absolute value inside of Gamma, as it's easy to go unnoticed
A: Without using floor or ceiling it can be done with limits. Start with a function of this form:
$$\lim_{c \to \infty} \left (\frac{y}{\sqrt2}-\frac{(x\cdot c)}{\sqrt2} = \sqrt[3]{1-\left ( \frac{y}{\sqrt2}+\frac{(x\cdot c)}{\sqrt2}  \right )^3  }  \right )$$
(Note: Using real-valued root not principal root)

This infinitely squashes (along x-axis) a 45º rotated graph of the form $x^3+y^3=1$ which causes the output values to be $0$ everywhere and $\sqrt[6]{2}$ at $0$. This can now easily be worked to achieve the desired affect by dividing by $\sqrt[6]{2}$ and subtracting from $1$
A: The following equation I’ve made works without using ceiling function or limits or infinite sums when plotting the real values. 1 at x=0 and 0 and a complex pair counterpart at all other values for x
$(y-1-\sqrt{x}-\sqrt{-x})\cdot\frac{y}{y-x}=0$
This can then be inverted to a less elegant form to have 0 for x=0 and 1 in all other places. 
I like this best because it’s pure closed form expression and doesn’t involve any elements like ceiling function that are hard to work with when using this in other places.  However it only works if you ignore complex answers which has problems of its own, but still is noteworthy and has application 
A: The following equation I've made is a closed-form expression of KroneckerDelta (j=0 form) which will evaluate y=1 at x=0 and y=0 for x≠0. 
$$(\frac{y}{y-x})\cdot((y-1)^2+x^2)=0$$
This function can be subtracted from 1 to achieve the desired result

The function was formed by taking the function for a horizontal line at 0, divided by a 45º line (y=x) through the origin to create a hole in the function at x=0, then multiplied by a circle with radius 0 whose origin is at (0,1) to create a point at (0,1).
A: An approximation of your desired function be of this form:
$$f(x) = \sqrt[10^{100}]{\lvert x \rvert}$$
Where $f(1\cdot10^{-50}) = 1$ while $f(0) = 0$.
