# Can you think of a function which is always equal to 1, except for a single point where it goes to zero?

for example if I wanted to create a function f which takes any input number x and always return 1 but returns 0 when x equals 5

f(1)=1;
f(2)=1;
f(3)=1;
f(4)=1;
f(5)=0;
f(6)=1;
f(7)=1;

-
Well...you have it already: $$f(x)=\begin{cases}1&,\;\;x\neq 5\\{}\\0&,\;\;x=5\end{cases}$$ –  DonAntonio Dec 19 '13 at 21:25
If you don't want to define it piecewise, $f(x)=\lceil \tanh^2 (x-a)\rceil$ will be $0$ at $a$ and $1$ everywhere else. –  L. F. Dec 19 '13 at 21:26
The function which is $0$ at $t=0$, $-1$ if $t\lt 0$, and $1$ for $t\gt 0$ has a standard name, the signum function sgn. So we can use $\text{sgn}(|x-5|)$ or $(\text{sgn}(x-5))^2$. –  André Nicolas Dec 19 '13 at 21:36

If you dont need $f$ to be continious then declare a picewise function which is 1 for all x exept from 5
$$f(x) = \begin{cases}1, \quad x\neq 5\\0, \quad x=5\end{cases}$$