Skip to main content

21 - Continuous functions

Repetition

These lecture notes are slightly repetitive with those of the previous lesson except here we do prove Theorem 4.8 in Rudin. It just takes a while longer to get there.

Where we left off last time

  • Recap: Last time we said what it means for a function to be continuous. To say the function f ⁣:XYf\colon X\to Y is continuous means the following:
    • Closeness: At each pXp\in X, for every ϵ>0\epsilon>0, there is a δ>0\delta>0 such that there exists xXx\in X where dX(x,p)<δd_X(x,p)<\delta implies that dY(f(x),f(p))<ϵd_Y(f(x),f(p))<\epsilon. That is, close enough points map to close points. That is, you have some function that is taking some space XX into some space YY, and we want to say it's continuous if it doesn't tear the space up in some way. For example, you could have a function that looks something like the following (poorly drawn but idea is face is split in half and separated):

      The above would not be a continuous function. Why is that? Well, because, morally speaking, there are close points in XX, as x1x_1 and x2x_2 pictured above, which get mapped far away in some sense, namely to f(x1)f(x_1) and f(x2)f(x_2).

      To be a little more precise, we want to say this function is continuous at a point pp if no matter how close you are in the codomain you can find a ball in the domain such that if you're within a ball from point pp then the image is within that ϵ\epsilon of the image of pp. So let's try to model this with our picture:

      Is ff continuous at pp for the pp chosen above (the drawing is bad but the idea should still come across)? No. Why not? Well, not the entire image of everything in the δ\delta-ball ends up in the ϵ\epsilon-ball (the slight corner that's missing):

      So we'd say no, the function ff is not continuous at the pictured pp because there is an ϵ\epsilon-ball (such as the one pictured) such that there is no δ\delta-ball around pp that will map entirely into the ϵ\epsilon-ball.

    • Sequences: Just to make this connection more integrated with some of the things we have seen, we also saw there was a sequence version of continuity as well, namely the following: For every convergent sequence {xn}\{x_n\} in XX, we have

      limnf(xn)=f(limnxn);\lim_{n\to\infty}f(x_n)=f\Bigl(\lim_{n\to\infty} x_n\Bigr);

      that is, the limit of the images is the image of the limit. (Continuous functions preserve limits.)

      In our picture, let's pick a point where we think the function ff is continuous. How about the point tt:

      So if we look at sequences that actually converge to tt, let's call those points tnt_n, then is it the case that their images, f(tn)f(t_n), converge to f(t)f(t)? If the answer is yes for all such sequences, then the function is continuous at that point tt.

Topological definition of continuity

What was the topological definition of continuity and how do we prove it?

  • Theorem statement: The function f ⁣:XYf\colon X\to Y is continuous if and only if for every open set UU in YY we have that f1(U)f^{-1}(U) is open in XX.

  • Remark about inverse images or preimages: Worth noting is to recall how the inverse image (also called the preimage) is defined: f1(U)={xf(x)U}f^{-1}(U)=\{x \mid f(x)\in U\}. So the inverse image is the set of all points that get mapped into UU. Particularly worth noting is that the inverse image need not be a function (the inverse f1f^{-1} is a function if and only if ff is one-to-one and onto). More precisely, if f ⁣:XYf\colon X\to Y is any function (not necessarily invertible), then the inverse image or preimage of an element yYy\in Y is the set of all elements of XX that map to yy:

    f1({y})={xX:f(x)=y}.f^{-1}(\{y\})=\{x\in X : f(x)=y\}.

    The preimage of yy can be though of as the image of yy under the (multivalued) full inverse of the function ff. Similarly, if SS is any subset of YY (just like we are dealing with an open set UU as a subset of YY in our theorem), then the inverse image of SS is the set of all elements of XX that map to SS:

    f1(S)={xX:f(x)S}.f^{-1}(S)=\{x\in X : f(x)\in S\}.

    For example, take a function f ⁣:RRf\colon\R\to\R defined by f(x)=x2f(x)=x^2. This function is not invertible. Yet inverse images may be defined for subsets of the codomain:

    f1({1,4,9,16})={4,3,2,1,1,2,3,4}.f^{-1}(\{1,4,9,16\})=\{-4,-3,-2,-1,1,2,3,4\}.

    The inverse image of a single element yYy\in Y, namely the singleton set {y}\{y\}, is sometimes called the fiber of yy. When YY is the set of real numbers, it is common to refer to f1({y})f^{-1}(\{y\}) as a level set.

    In our context, maybe we have the following picture:

    We could ask what the inverse image of UU is here. What is that? It will be the set of all points in XX that are mapped into UU. As noted above, the function ff may not actually have a corresponding inverse function, but the image of ff will have an inverse image. Consider the following picture:

    Suppose we have the following mappings:

    x1fαx2fβx3fγx4fδx5fδx6fδ\begin{align*} x_1 &\stackrel{f}{\mapsto} \alpha\\[0.5em] x_2 &\stackrel{f}{\mapsto} \beta\\[0.5em] x_3 &\stackrel{f}{\mapsto} \gamma\\[0.5em] x_4 &\stackrel{f}{\mapsto} \delta\\[0.5em] x_5 &\stackrel{f}{\mapsto} \delta\\[0.5em] x_6 &\stackrel{f}{\mapsto} \delta \end{align*}

    We see that the inverse image of UU is f1(U)={x1,x2,x3,x4,x5,x6}f^{-1}(U)=\{x_1,x_2,x_3,x_4,x_5,x_6\} even though x4x_4, x5x_5, x6x_6 all map to δ\delta. So the function f ⁣:A1A2Uf\colon A_1\cup A_2\to U would not have an inverse function. However, the function f ⁣:A1Uf\colon A_1\to U would have an inverse function.

  • Revisiting theorem: What does it mean for a function to be continuous? We claim it's equivalent to saying the inverse image of any open set UU in YY is open. Let's consider the following picture of a function:

    What is the inverse image of U1U_1 for the figure above? Well, it's the set of all points that get mapped into U1U_1. We can figure that out by just looking at what gets mapped in there. What gets mapped into U1U_1? Well, it looks like two intervals:

    Note that the sets on the XX-axis are open are they not? So f1(U)f^{-1}(U) consists of those two sets. We see that the sets on the XX-axis do not contain their endpoints because how we've drawn U1U_1 does not contain its endpoints either. Maybe we consider another open set U2YU_2\subset Y:

    What will the inverse image of U2U_2 be?

    Notice that there no points get mapped to above the curve in U2U_2, but there are points that get mapped to in the indicated region. So the inverse image of any open set is open so long as the function is continuous. What would go wrong if the function were not continuous? Suppose we have the following function:

    Can you show me an open set in YY for the function above whose inverse image is not open in XX? How about an open set that encloses the bolded dot but not the open one? How about the following:

    We see that f1(U)f^{-1}(U) is actually not open. We have a half-open interval. Since we found just one open set in YY whose inverse image was not open, we know the function ff pictured above is not continuous.

    Maybe we consider a function f ⁣:EYf\colon E\to Y, where EE is not the whole real line but just some subset of it (in the picture below the subset EE is just the point on the XX-axis along with the open interval):

    Is the function above continuous? Yes. The only place where we worry about it not being continuous is at the single point (let's call it pp) off to the left when we are using the ϵ\epsilon-δ\delta definition or if you use the limit definition. There's only one sequence that converges to the point pp on the XX-axis, namely {p,p,p,}\{p,p,p,\ldots\}, and the limit of the images of this sequence is pp, and f(limnpn)=f(p)f(\lim_{n\to\infty} p_n)=f(p) so it satisfies the sequence characterization of continuity. Is it the case here that the inverse image of open sets is open? We might be worried about the following set:

    What's f1(U)f^{-1}(U) for the identified open set UU above? It's just the point on the XX-axis. Is this a problem? No, why not? The inverse image is just a single point, but this point is open in EE. Why? Because there is a ball around that point in EE, and the ball only contains that one point so that point by itself is open in EE.

    So our pictures and example problems jibe with the definition of continuity we have given. Let's now try the proof.

  • Restatement of theorem (as seen in [17]): A mapping ff of a metric space XX into a metric space YY is continuous on XX if and only if f1(U)f^{-1}(U) is open in XX for every open st UU in YY.

  • Forward direction (proof): Let's remind ourselves what it means for a function to be continuous. What it means for a function to be continuous is no matter which point you are at in the codomain, let's say we pick pp in the domain and f(p)f(p) in the codomain, then you draw an ϵ\epsilon-ball around f(p)f(p), and there is a corresponding δ\delta-ball in the domain whose image is mapped completely into the ϵ\epsilon-ball. That's the ϵ\epsilon-δ\delta definition of continuity. So we'll be able to use that fact if we need it.

    Now, what's our goal in this part of the proof? We are proving the forward direction which means we are assuming that f ⁣:XYf\colon X\to Y is continuous on XX (i.e., for every point in XX). So the goal, assuming continuity of ff, is to show that the inverse image of open sets is open. So we should start with an arbitrary open set UU in YY. Maybe we have a picture that looks like the following:

    Our goal, in fact, is to show that the inverse image of UU or f1(U)f^{-1}(U) (i.e., the set of all points in XX which get mapped into UU) is also open in XX. We have no idea what the inverse image of UU looks like, but maybe it looks something like the following:

    Who knows whether or not the blobs in XX pictured above are open? The two blobs together form f1(U)f^{-1}(U). How do we show f1(U)f^{-1}(U) is open? How do we show any set is open? Pick a point inside of f1(U)f^{-1}(U), say xx:

    What do we do with this point xx? We want to show that xx is an interior point. How do we show that xx is an interior point of f1(U)f^{-1}(U)? There's a ball around xx whose images lie completely within UU. But why is that? Why is there a tiny little ball around xx whose image lies completely in the set UU? Because ff is continuous! What does that have to do with it? Let's consider the image of our point xx in UU:

    Why should there be a ball around f(x)f(x)? Because UU is open. Good. So that means f(x)f(x) is interior of UU so that's some ball of radius ϵ\epsilon. So let's draw an ϵ\epsilon-ball around f(x)f(x) to represent this:

    Now, because of continuity, there's a δ\delta-ball around xx:

    What's true about the δ\delta-ball around xx? Its image ``blob'' lies completely in the ϵ\epsilon-ball:

    Since this blob lies completely in the ϵ\epsilon-ball, then it lies completely within UU. Let's write out explicitly what we have done in our picture(s).

    Given UU open in YY, consider xf1(U)x\in f^{-1}(U). We will show xx is an interior point of f1(U)f^{-1}(U). Note f(x)Uf(x)\in U, where UU is open. Thus, there exists an ϵ\epsilon-ball Nϵ(f(x))UN_\epsilon(f(x))\subset U. By continuity, there exists a δ\delta-ball Nδ(x)N_\delta(x) that maps into Nϵ(f(x))UN_\epsilon(f(x))\subset U. Thus, Nδ(x)f1(U)N_\delta(x)\subset f^{-1}(U). So xx is an interior point of f1(U)f^{-1}(U), as desired, thus concluding the proof of the forward direction of the theorem.

  • Backward direction (proof): For the reverse direction, we want to assume that inverse images of open sets are open. And we want to show that, in fact, the function is continuous, and we'll use the ϵ\epsilon-δ\delta definition. So how do we do that? Well, start by fixing some pp in XX no matter which one. (We don't care because this will be a general argument.)

    Fix pXp\in X, and pick some ϵ>0\epsilon>0. To show continuity, we want to show that for every ϵ>0\epsilon>0 there is a δ>0\delta>0 such that blah blah blah. So our job is to find a δ>0\delta>0. That's our goal. Now, you will hopefully use the idea that inverse images of open sets are open (otherwise there would be little sense in claiming the concepts are equivalent). How will we use this idea? Let's draw a picture of the starting situation, where a pXp\in X has been fixed:

    Now, just like before, we'll start off by looking at f(p)Yf(p)\in Y:

    We'll take an ϵ\epsilon-ball around f(p)f(p):

    Our job here is to find a δ\delta-ball around pp such that the δ\delta-ball maps completely into the ϵ\epsilon-ball. Now, the inverse image of open sets is open. Is there an open set on which we can use that fact to our advantage? How about the ϵ\epsilon-ball? It's an open set. Thus, its inverse image, whatever it is, could look very strange:

    It may be helpful to introduce some notation here: Let the ϵ\epsilon-ball around f(p)f(p) be denoted by BB, and by hypothesis, the inverse image of BB or f1(B)f^{-1}(B) is open in XX:

    Why does that mean there is a δ\delta-ball that maps completely into that ϵ\epsilon-ball? Since f1(B)f^{-1}(B) is open, and pp lives in the inverse image of BB, what can we say? We know f1(B)f^{-1}(B) maps onto the ϵ\epsilon-ball. The point pp is interior to the open set f1(B)f^{-1}(B) and must therefore have a ball around it. And we'll call the radius of this ball δ\delta, and that will be the δ\delta we want to use:

    Let's try to formalize what we've communicated with pictures above.

    Let BB be an ϵ\epsilon-ball about f(p)f(p) in YY. Then pf1(B)p\in f^{-1}(B), which is open by assumption. Since pp is an interior point of f1(B)f^{-1}(B), there exists some ball Nδ(p)N_\delta(p) that lies completely within f1(B)f^{-1}(B). This δ\delta has the required property. Why? It is certainly true that if you are within this δ\delta-ball then the image lies in the ϵ\epsilon-ball. Why? Because the δ\delta-ball lies in the inverse image of BB, the ϵ\epsilon-ball. In summary, the chosen δ\delta has the required property that ensures f(Nδ(p))Bf(N_\delta(p))\subset B, as desired. Thus, ff is continuous.

    As a side note, it should be observed that in the picture(s) above, the ϵ\epsilon-ball could very will be partially outside of YY, where there would then be no preimage for part of it. But that is fine. We're verifying whether or not our function ff is continuous at pXp\in X. So we'll be looking at some f(p)f(p). Thus, at the very least, the point f(p)f(p) will have a preimage. But we don't necessarily know that anything around it has a preimage. It could be the case that the entire blob pictured above in XX gets mapped to the single point f(p)f(p). That's fine. But then what does an open set around f(p)f(p) look like? It will be a ball, but the only thing it will have in its preimage will be that blob.

    Let's now see why this characterization of continuity is very useful.

  • Continuity with compositions (see [17]): Consider the continuous functions f ⁣:XYf\colon X\to Y and g ⁣:YZg\colon Y\to Z or simply XfYgZX\stackrel{f}{\to} Y\stackrel{g}{\to} Z. The composition of ff and gg is then continuous; that is, gfg\circ f is continuous.

    Rudin proves this using the ϵ\epsilon-δ\delta definition, but we can have more fun with it now given the definition of continuity involving open sets. So we can use the ϵ\epsilon-δ\delta definition if we like, but it's messier than it needs to be. Let's think about this in terms of the open set characterization of continuity.

    If we want to show the composition XfYgZX\stackrel{f}{\to} Y\stackrel{g}{\to} Z is continuous, where we do ff first and then gg, all we have to do is show that the inverse image of an open set in ZZ is open in XX. What should we do? Given UU open in ZZ, g1(U)g^{-1}(U) is open in YY since gg is continuous. Then f1(g1(U))f^{-1}(g^{-1}(U)) is open in XX since ff is continuous. But this is just (gf)1(U)(g\circ f)^{-1}(U), which is thus open and what we wanted to show, thus concluding the proof.

  • Another consequence (concerning closed sets): If the inverse image of open sets is open, what is likely to be the inverse image of closed sets? A closed set. Why? By taking complements. Here's the theorem:

    The function f ⁣:XYf\colon X\to Y is continuous if and only if for all closed KYK\in Y then f1(K)f^{-1}(K) is closed in XX.

    The proof idea is as follows: If we look at f1(K)f^{-1}(K) and f1(Kc)f^{-1}(K^c), what might be their relationship? It's the set of all things that are mapped into KK (i.e., f1(K)f^{-1}(K)) and the set of all things that are mapped into the complement of KK (i.e., f1(Kc)f^{-1}(K^c)). Could they contain anything in common? No, so they're disjoint. Do they contain everything? Yes, they do. So, in fact, we have f1(K)=[f1(Kc)]cf^{-1}(K)=[f^{-1}(K^c)]^c.

    So if we use our original idea, where we know that KK is closed, then we know KcK^c is open, and the inverse image of an open set is open, and the complement of that is closed. The following visualization may help:

    [f1((Kclosed)copen)open]cclosed=f1(K)closed.\underbrace{[\underbrace{f^{-1}(\underbrace{(\underbrace{K}_\text{closed})^c}_{\text{open}})}_{\text{open}}]^c}_{\text{closed}}=\underbrace{f^{-1}(K)}_{\text{closed}}.

    That's a nice, easy consequence.

  • Preservation of compactness for continuous functions: Continuous functions have the curious property that they preserve limits, but they also preserve compactness. Here's a theorem (see [17]): If f ⁣:XYf\colon X\to Y is continuous and XX is compact, then f(X)f(X) is compact.

    In other words, if the domain is small, if that space XX is small in some sense (recall compact means a set is small in a way, and it's the next best thing to being finite), then its image can't be too big. That's basically what this theorem is saying. Let's give a proof and a quite nice one at that. Consider the space XX getting mapped into YY in the following way:

    Now, suppose the rest of XX, that is X{x1,x2,x3,J}X\setminus\{x_1,x_2,x_3,J\}, gets mapped to just a subset of YY, not necessarily all of YY:

    The claim is that the image on the right-hand side (i.e., f(X)f(X)) is compact if XX is compact. So how do you show that a set is compact? Take an open cover of the creature f(X)f(X) and show it has a finite subcover. So let's take an open cover of f(X)f(X), where there may be infinitely many such open sets involved in the open cover:

    Let {Vα}\{V_\alpha\} denote the cover sets that cover f(X)f(X). Now what? Well, ff is continuous; thus, what's really useful here is the open set characterization of continuity. How can that be of use here? Well, this characterization tells us that each of the sets f1(Vα)f^{-1}(V_\alpha) is open; hence, we'll get a bunch of open sets f1(Vα)f^{-1}(V_\alpha) covering the domain in some fashion:

    Now, since XX is compact, there exists a finite subcover of XX; that is, there are finitely many indices, say α1,,αn\alpha_1,\ldots,\alpha_n, such that

    Xf1(Vα1)f1(Vαn).X\subset f^{-1}(V_{\alpha_1})\cup\cdots\cup f^{-1}(V_{\alpha_n}).

    Then Vα1,,VαnV_{\alpha_1},\ldots,V_{\alpha_n} cover f(X)f(X). Why? Well, that's just what it means. The inverse image covers XX then all the points are in some inverse image. Therefore, applying ff to those points puts them in {Vα}\{V_\alpha\} which covers f(X)f(X). More concretely, if xf1(Vα)x\in f^{-1}(V_\alpha), then xx is the inverse image of some point. So f(x)Vαf(x)\in V_\alpha.

  • Remarks following theorem: This should be somewhat surprising. You have a compact set, and its image has to be compact. Recall what the theorem we just proved is saying: If the domain is small (i.e., if XX is compact), then the image of our continuous function also has to be small (i.e., f(X)f(X) is compact). We might think, in the context of the real numbers, of trying to map an interval onto the whole line. If we consider an interval like (0,1)(0,1), which is not a compact set, then we can imagine mapping it onto R\R (i.e., we essentially stretch the interval (0,1)(0,1) to cover all of R\R). In particular, consider tanx\tan x, which is continuous on (π/2,π/2)(-\pi/2,\pi/2) and maps onto R\R. With only a slight modification, we could consider the function ϕ(x)=tan(π(x12))\phi(x)=\tan(\pi(x-\frac{1}{2})). Then ϕ\phi is mapping (0,1)(0,1) onto R\R. In other words, the image of an intuitively small set such as (0,1)(0,1) can be made to be extremely large such as all of R\R, as with the case of ϕ\phi. (Note: This answer on MSE has a better example of a direct map that stretches the unit interval (0,1)(0,1) onto R\R.)

    Now, recall that [a,b][a,b] is a compact set. So what the theorem we just proved tells us is that it is not possible to map something like [0,1][0,1] onto R\R if ff is continuous. That's impossible because the endpoints have to go somewhere basically.

  • Corollary about boundedness (see [17]): If f\mathbf{f} is a continuous mapping of a compact metric space XX into Rk\R^k, then f(X)\mathbf{f}(X) is closed and bounded. Thus, f\mathbf{f} is bounded.

    Why is the above true? Well, the image f(X)\mathbf{f}(X) has to be compact, and in Rk\R^k, by the Heine-Borel theorem, it has to be closed and bounded.

  • Corollary about obtaining a maximum and minimum (see [17]): Let XX be a compact metric space. Then the continuous function f ⁣:XRf\colon X\to\R achieves its maximum and minimum.

    We use this fact all the time in single- and multivariable calculus when doing optimization problems. In single variable, we are mapping intervals to intervals. In multivariable, we are mapping discs, balls, etc., to other discs, balls, etc. If the intervals, discs, balls, etc., that we are mapping from are compact (bear in mind our mapping is continuous here), then the mapping must achieve its maximum and minimum. Why? Well, its image has to be closed and its image has to be bounded. Its image, being bounded, means it has a supremum and an infimum. Being closed, it means it must contain its supremum and infimum. Done. This is an amazing fact.

  • Corollary concerning bijections (see [17]): Let f ⁣:XYf\colon X\to Y be a bijective mapping (i.e., one-to-one and onto) that is continuous and XX is compact. Then f1f^{-1} is continuous.

    In general, when we have a bijection, we have a one-to-one correspondence, and we can talk about the inverse function because every point has an inverse, a unique inverse. And you might worry that if the forward direction (i.e, mapping XX into YY) is continuous, then is it necessarily true that the backward direction is continuous as well? The answer is no, not necessarily. But if XX is compact, then the forward direction being continuous, in fact, implies that the backward direction is continuous too, which is rather amazing. Let's prove this.

    To show an inverse image is continuous for an inverse function, what you're really trying to show is that if you take an open set in XX, then the inverse of the inverse, which is going forward, is open in YY. (That's the inverse image of the inverse function. It's going forwards from XX into YY.) Let UU be open in XX. Then UcU^c is closed. Since UcU^c is closed, we can use the closed set characterization of continuity as follows: the set UcU^c is closed in a compact set XX. Thus, UcU^c is compact. But if UcU^c is compact, then its image f(Uc)f(U^c) is compact. But if its image is compact, then it has to be closed. Thus, f(U)f(U) is open, which is enough to show that the inverse function is continuous.

  • Remark about homeomorphisms: A bijective function that is also bicontinuous is sometimes called a homeomorphism. What it means is that the domain and codomain are topologically equivalent.