What is the motivation to continuous functions and measurable functions? In topology the objects of interest are the space open sets, and a function will be continuous if the inverse image of any open set is an open set. 
In measure theory the objects of interest are the measurable sets, and a function will be measurable if the inverse image of any measurable set is a measurable set.
What is the motivation and importance of the "inverse image" operation, and how this idea has been generalized?
 A: *

*First, a few words about inverse images. If $X$ is a set, then the powerset $\mathcal{P} X$ is a poset. If $f: X \to Y$ is a function, then the inverse image function $\mathcal{P}Y \to \mathcal{P}X$ is order-preserving, and it has both left and right adjoints -- which in particular means it preserves both meets and joins. The left adjoint is the forward-image function but it doesn't have its own left adjoint, and correspondingly it doesn't preserve joins. So inverse image has better properties than forward image.
Also, even if you don't consider the poset structure on $\mathcal{P}X$, it's still the homset $[X,2]$, and inverse image is just the precomposition function $[Y,2] \overset{[f,\mathrm{id}]}{\to} [X,2]$. The forward image doesn't admit such a simple description.

*Next, let me just write down the obvious analogy between topological spaces and measure spaces, in a not-particularly-elegant way.
A topological space is a set equipped with a geometric sublattice (i.e. closed under finite meets and arbitrary joins) of its powerset; a continuous map is a function between carrier sets whose inverse image preserves the sublattice. A measurable space is a set equipped with a boolean sigma-sublattice (i.e. closed under countable meets and joins, and under complements); a measurable map is a function between carrier sets whose inverse image preserves the sublattice.

*So in each case we have a functor, in both cases called $\mathcal{P}: \mathsf{Set} \to \mathcal{C}^\mathrm{op}$ (where $\mathcal C$ is respectively the category $\mathsf{GeomLat}$ of geometric lattices and $\sigma \mathsf{Bool}$ of Boolean $\sigma$-lattices), and the category we're interested in is the full subcategory of the comma category $(\mathcal{C}^\mathrm{op}\downarrow \mathcal{P})$ whose objects are monomorphisms in $\mathcal{C}$.
In both cases, $\mathcal{P}$ factors through $\mathcal{P}: \mathsf{Set} \to \mathsf{CompLat}^\mathrm{op}$ (here $\mathsf{CompLat}$ is complete lattices and meet-and-join-preserving maps), via obvious forgetful functors $\mathsf{CompLat} \to \mathcal{C}$. Also, I'm not sure how relevant this is, but in both cases $\mathcal{C}$ is monadic over $\mathsf{Set}$ (although the monadic functor doesn't appear in this picture).

*I believe both forgetful functors $\mathsf{Top} \to \mathsf{Set}$, $\mathsf{Meas} \to \mathsf{Set}$ are topological functors. This has to do with the fact that the lattice of all topologies (resp. the lattice of all measurable structures) on a set $X$ is itself a complete lattice.
There is a structure theory for topological categories over $\mathsf{Set}$ which you can read about in The Joy of Cats. I'm a little confused about how it applies to $\mathsf{Top}$ and $\mathsf{Meas}$, though.

*There's an interesting way to construct $\mathsf{Top}$ 2-categorically: just as the algebras of the ultrafilter monad are compact Hausdorff spaces, so the lax algebras of the ultrafilter monad (in a suitable 2-categorical sense) are exactly topological spaces. See here for details. I'm not aware of an analogous construction of $\mathsf{Meas}$; this is related to the discussion in the comments about the lack of a "convergence"-like relation for measurable spaces.

*$[-,2]: \mathsf{Set}^\mathrm{op} \to \mathsf{Set}$ is right adjoint to itself, and is in fact monadic (this is irrelevant, I just can't help myself mentioning it). But for what it's worth, consider the underlying functor $T = [[-,2],2]: \mathsf{Set} \to \mathsf{Set}$ of the induced monad. A topology or a measure on a set $X$ is just a map $1 \to TX$ satisfying some properties. $\mathsf{Top}$ and $\mathsf{Meas}$ are kind of like full subcategories of the slice category $(1 \downarrow T)$, except that would require every open (resp. measurable) set to be a preimage of an open (resp. measurable) set in order for a map to be "continuous" (resp. "measurable"); if we could just take an appropriate sort of lax slice category we'd have what we want. But I'm not sure about the details.

*For lots of purposes, you can forget about the points of a topological space and just work with the open sets. This is called locale theory. I presume people do similar things with $\sigma$-lattices. This removes a lot of the awkwardness of these analogous descriptions, and just leaves us with (the opposites of) two natural subcategories of the category of lattices.
