A continuous function defined on an interval can have a mean value. What about a median?
A function can have an average value
$$\frac{1}{b-a}\int_{a}^{b} f(x)dx$$
Can a continuous function have a median?
How would that be computed?
That would be $y$ so that the subsets of $[a,b]$
$\{x \in [a,b] \ | \ f(x) \le y\}$ and $\{x \in [a,b] \ | \ f(x) \ge y\}$
have the same measure (with some care).
Obs: if $f$ is monotonous it will be $f(\frac{a+b}{2})$.
Sure. The median $m$ of a set of numbers $\{x_1,...,x_n\}$ is $x$ so that $x_i\leq x$ for half the $i$ and otherwise $x_i\geq x$-ignoring the details about $n$ being even or odd. So for simplicity suppose $f:[0,1]\to \mathbf{R}$ is continuous. Then we'll define analogously the median of $f$ to be $m$ such that "$f$ is below $m$ half the time and above $m$ half the time," more precisely, such that the length of $\{x:f(x)\leq m\}=1/2$, and similarly for $\{f(x)\geq m\}$. (Here we'll need the convention that we split $\{f(x)=m\}$ evenly to each half, to handle special cases like $f\equiv m$.)
To compute this, we need a function $g$ associated to $f$. Namely, take $g(y)$ to be the length of $\{x:f(x)\leq y\}$. Now $g$ is not necessarily continuous: if for instance $f$ is constant at $m$ as above, then $g(y)=0,y<m, 1\text{ otherwise.}$ But it is "upper continuous", that is, $\lim_{y'\to y^+} g(y')=g(y)$. I'll avoid arguing for this in detail-the point is essentially that if $f(x)\leq y+\epsilon$ for every $\epsilon$ then $f(x)\leq y$. Since $g$ is upper continuous, if we define $m=\inf\{y:g(y)\geq 1/2\}$ then we'll be guaranteed $g(m)\geq 1/2$, and we can define $m$ as our median.
So, this is a lot harder than defining the mean, yes? There are still some issues we haven't worked out: is $g$ even well defined? $\{x:f(x)\leq y\}$ could be an extremely weird set-how do we measure its length? For this we have to defer to a much more advanced topic than calculus, which is called measure theory. However, if $f$ is increasing, then $\{x:f(x)\leq y\}$ will just be an interval, and so we can in principle compute $g$ without any fancy knowledge.
So let's try an example or two. For $f(x)=x,$ we get $g=f$ and $m=1/2$, the same as the means: this shows that linear functions are the continuous analogue of distributions that aren't skewed, which in the finite case are the ones that have the same median as mean. How about $f(x)=x^2$? We get $g(y)=\sqrt y$, so $m=1/4$. But the mean of $x^2$ is $1/3$, so we see $x^2$ is "skewed to the right-"as you can see from its graph! In general, if $f$ is strictly increasing and $f(0)=0$, then as happened here we'll get $g=f^{-1}$, so that it'll be possible to compute the median as $f^{-1}(1/2)$. You can work out similar statements if $f(0)\neq 0$, but to move away from the increasing case things will become increasingly subtle.
Sure a continuous function can have a median, as for if it always has a median I am unsure of.
Let's suppose we have a some function $f$ and it is continuous on $[a,b]$. We want to find its median $m$. We know that if $m$ is a median than if we take any value $c \in [a,b] $ at random then the $P(c \leq m) = $$P(c \geq m) = 1/2 $. Now if we want to construct such a function we need to "normalize" it in a sense.
So let's say we take the integral of $f$ over $[a,b]$ and it is equal to $S$.
$\int_a^b f(x)dx = S$
Now let $=g(x) = \frac{1}{S}f(x)$ so that we have
$\int_a^bg(x)dx = 1$.
Now if we want to find the median of $g(x)$ and therefore $f(x)$ we simply need to find an $m$ such that
$\int_a^mg(x)dx = 1/2$