# Function that is non-zero only at one point.

I am searching for, if there exists, a continuous function $f(x)$ such that $f(x) = 0$ for all values of $x$, with the exception of one point (say $\tilde x$) where $f(\tilde x)\neq0$.

• One example is en.wikipedia.org/wiki/Dirac_delta_function – taninamdar Sep 18 '14 at 10:21
• Could you be more specific? Because $f(x)$ is a function, not an equation. Also, are there any restrictions on $f(x)$? If not then I would suggest $f(x)=\begin{cases}0,\, \text{for }x\neq a\\ b,\,\text{for }x=a\end{cases}$ where $a,b\in\mathbb R$. – gebruiker Sep 18 '14 at 10:23
• What about the function $$f(x)=\begin{cases}0&,\;\;x\neq 18\\{}\\46.7&,\;\;x=18\end{cases}\;\;\;\;\;\;?$$ – Timbuc Sep 18 '14 at 10:23
• Let $f$ be the continuous extension of $\frac{\sin x}{x}$. What is $floor(f(x))$? – user5402 Sep 18 '14 at 13:23
• @taninamdar The (unfortunately named) Dirac delta function isn't a function, it's a distribution. – Travis Willse Sep 19 '14 at 4:21

This function cannot exist, if it must be continuous.

Suppose such a function $f:R \to R$ exists, and for some $x \in R$, $f(x) = c \ne 0$. Let $y \ne x$. By the Intermediate Value Theorem, then $\exists z \in [x, y]$ (or $[y, x]$) such that $0 < f(z) < c$.

• This assumes that the domain of $f$ are the reals. See MPW's answer for an example; using an arbitrary set (like, say, $\{0,1\}$) with the discrete topology as the domain is even easier. – Klaus Draeger Sep 18 '14 at 12:10

This is possible if and only if $\tilde x$ is an isolated point of the domain.

Example 1: For example, the domain could be $$(-\infty,\tilde x - \epsilon)\cup \{\tilde x\}\cup (\tilde x +\epsilon,\infty)$$ if it is a subset of $\mathbb R$ (which, incidentally, is not specified) and the function rule could be $$f(x) = \begin{cases} 0 & \textrm{ if }x <\tilde x - \epsilon\\ c & \textrm{ if }x = \tilde x \\ 0 & \textrm{ if }x > \tilde x +\epsilon \end{cases}$$

where $\epsilon$ is a positive constant and $c$ is a nonzero constant.

For example, you could have $$f:(-\infty,-1)\cup \{0\}\cup (1,\infty) \rightarrow \mathbb R$$

with

$$f(x) = \begin{cases} 0 & \textrm{ if }x <-1\\ 1 & \textrm{ if }x = 0 \\ 0 & \textrm{ if }x >1 \end{cases}$$

Example 2: An even simpler example of such a function would be $$f:\{0,1\} \rightarrow \mathbb R$$ with $$f(x) = \begin{cases} 1 & \textrm{ if }x = 0 \\ 0 & \textrm{ if }x =1 \end{cases}$$

• Can you show me an example? – The Light Spark Sep 18 '14 at 12:20
• I edited the answer to show an example for the domain I stated – MPW Sep 18 '14 at 14:23
• I feel like if you're going to allow domains other than R, it's awkward not to allow codomains other than R as well. Perhaps the codomain is equipped with the indiscrete topology. – user2357112 supports Monica Sep 18 '14 at 19:04
• @user2357112: The point here is that the only way you can get such a function is to restrict the domain of a candidate function $\mathbb R\rightarrow\mathbb R$, if we are dealing with real-valued functions of a (possibly restricted) real variable. Otherwise, it's not possible, as others have indicated in their answers. – MPW Sep 18 '14 at 19:13
• @user2357112: Also, since the OP speaks of the function taking on zero or nonzero values, I presume he intends the range to be $\mathbb R$ (or $\mathbb C$, I suppose), unless his "zero" is in some other exotic space, which I seriously doubt. – MPW Sep 18 '14 at 19:16

There is no continuous function $f:\mathbb{R}\rightarrow\mathbb{R}$ such that $f(x)=0$ for all $x\not=x_0$ and $f(x_0)\not=0$, since by definition of continuity

$$f(x_0)=\lim_{x\rightarrow x_0,x\not=x_0} f(x)=0$$

Because the additional condition of continuity, it is not possible. You can use limits at the only point where the function is non-zero to prove that such a function will not be continuous.

I think perhaps your prof used poor wording and meant piecewise continuous, and they are looking for the function given by gebruiker at the top. Had this happen to me in Real Variables and confused me. It is a function and piecewise continuous (over an infinitely large set too!) and if your studying Lebesgue measure/integrals then that is what you want.

f(x) = 0 when x ≠ xStar, f(x) = c when x = xStar

If you are not studying Lebesgue measure or integrals, and in Reimann then use the intermediate value to show DNE as stated by C. Quilley at the top.

Have a nice day!

The Heaviside Step function, a generalized function, performs part of the function initially defined.

https://en.wikipedia.org/wiki/Heaviside_step_function

This function was created by Heaviside to represent the on and off turning of a switch.

A combination of two of these functions can describe the complete function above.

As noted, the derivative of the Heaviside function is a Dirac delta function.

https://en.wikipedia.org/wiki/Dirac_delta_function

• While the Heaviside and Dirac Delta functions are interesting and worth knowing about, they don't meet the criteria specified in the question. Specifically, the function must be continuous. – user231101 Oct 17 '16 at 21:35
• How about $lim_{n\to\infty} (e^{-|x|})^n$ ? That is continuous and its value is 1 at $x = 0$. All other points should tend to 0. – Srini Oct 17 '16 at 21:44

Delta Function(impulse function) in x=0 f(0)=inf , x!=0 f(x)=0 this function use in physics as impact function or in electrical engineering for sudden current or voltage and this function is very important.

• Yes, but it is not continous, which the question is about. – naslundx Sep 18 '14 at 10:46

Everyone seems to be mistaken about what continuity of a function actually means. The Dirac Delta function answers the question (as others have already suggested). The Dirac delta is a continuous function; as defined by its integrability i.e. the n-dimensional integral of any n-dimensional Dirac delta function is unity (it would be naturally non-integrable if it was discontinuous).

Looking at it from a slightly more intuitive angle; it can be recognised that the Dirac delta is derived via the integration of a complex valued exponential function (which are naturally continuous).

• The dirac delta is not a function, it's a distribution, and no matter how you look at it, it's not a continuous one in the usual topology on $\Bbb R$. For that we know that $$\lim_{n\to\infty}f(x_n)=f\left(\lim_{n\to\infty}x_n\right)$$ taking a limit as $x_n\to 0$ should give one $0$, not anything else. – Adam Hughes Sep 18 '14 at 17:57
• That's just the thing it's not continuous, you cannot define a function to be continuous and to have specific values, if you have an explicit formula you need to check that it is continuous. And the $x_n$ aren't going to $\infty$, they're going to $0$, where the value of $\delta$ doesn't match the limit, hence not continuous. What $\delta$ is, is a distribution which means it takes integrable functions and returns numbers, but it's not a function on $\Bbb R$, and certainly it's not continuous on $\Bbb R$ (in the usual topology). – Adam Hughes Sep 18 '14 at 18:10
• Errr, no they're not. the sine function is not integrable, it's just measurable, and locally integrable. I'm not sure what you're talking about with infinite boundaries and such, because all that's being focused on is continuity. Any basic calculus book gives a definition of continuity, and $\delta$ fails to satisfy it. Which, of course, also means it fails to be differentiable. Integration of (not a function) doesn't make sense, unless you mean integrals in the distributional sense (which comes up colloquially because of Riesz Representation). Physicists can be as imprecise as they like, but – Adam Hughes Sep 18 '14 at 18:22
• @AdamHughes is correct here. I'm afraid Christopher's comments are essentially incorrect or meaningless (sorry). – MPW Sep 18 '14 at 19:04
• Integrable does not imply continuous.. – JP McCarthy Sep 19 '14 at 9:57