How is defined the output of an exponential function when the input is not a rational number? Suppose $f$ is a function such that $f(x)= 2^x$. 
Certainly, $f$ is defined when $x$ is an integer. 
It is also defined when $x$ is a rational number such that $x=\frac mn$ ( with $m$ and $n$ integers), for in that case we have an exponent rule telling us that : 
$2^\frac mn$ = $\sqrt[n]{2^m}$. 
But since function $f$ is continuous on $R$ ( the set of real numbers), it must also be defined when the exponent $x$ is not a rational number, and hence cannot be written as a fraction. 
So for example, how is $f(\pi)=2^\pi$ defined? 
 A: That's a good question and there are two standard answers.
1) Based on calculus.
Forget everything.
Note that that for $t > 1$ that $\frac 1t >0$ so that if $F(x)=\int_{1}^{x}\frac 1t dt$ when viewed as "the area under a curve for $\frac 1t$ from $t=1$ to $t=x$" is a continuous monotonically increasing function. Thus it is one-to-one/injective.  A little bit of work we can see that $\lim_{x\to \infty}F(x) =\int_{1}^{ \infty} \frac 1t dt =  \infty$ and $\lim_{x \to 0^+} F(x) = \lim_{x \to 0^+} \int_1^x \frac{1}{t} dt = - \infty$. 
Thus $F: (0, \infty) \to \mathbb R$ is injective and surjective (so bijective and invertible) function.
We define $Ln(x) := F(x)$.  And we define $Exp(x) = Ln^{-1}(x)$, the inverse function of $Ln$.  It's easy to see $Ln(1) =0$ so $Exp(0)=1$ and that for $0< x<1$ then $Ln(x)<0$ so for $w<0$ that $0<Exp(w)< 1$ and for $x > 1$ and $w>0$ that $Ln(x) > 0$ and $Exp(w)> 1$.  And that there is a real number $e$ so that $Ln(e) =1$ and by the nature of $Ln(x) =\int_{1}^x \frac 1t dt$ that $e=\lim_{n\to \infty} (1+\frac 1n)^n$.
Using basic laws of derivatives and antiderivatives we can show that $Ln(xy)= Ln(x)+Ln(y)$ (assuming $x,y$ are positive) and that $Exp(x+ y)= Exp(x)Exp(y)$.
Then we define for any $b > 0$ that we be use as notation $b^x = Exp(Ln(b)*x)$.  From this we can show that if $x\in \mathbb N$ that $b^x=\underbrace{b\cdot....\cdot b}$ and by extension if $x\in \mathbb Q$ then $b^x$ is .... the exponential function we all know and love.
Also $e^x = Exp(Ln(e)*x)=Exp(1*x) = Exp(x)$ and if we define (for $b>0;b\ne 1$) the notation $log_b M$ as being the unique $k$ so that $b^k=M$ then $log_b M$ can be shown to be equal to $log_b M = \frac {Ln(M)}{Ln(b)}$
This may seem artificial and completely backwards (at least it does to me) but it is actually the most common definition and it has the advantage in that it works, and it very powerfully introduces the natural exponent and logarithm and immediately validates the obscure fact that the derivative of the natural log of $x$ is $\frac 1x$ and that the anti derivative of $\frac 1x=x^{-1}$ which ought to be $\lim_{h\to 0} \frac 1h x^h= \ln x$.
2) limits.
For every real number $x$, rational or irrational, there is a Cauchy sequence of rational numbers $\{q_n\}$ so that $\lim_{n\to \infty} q_n = x$.  (That's basically the definition of the real numbers.)
We can show that the sequence $\{b^{q_n}\}$ converges to a real number.  And we can show that if $\{q_n\}$ and $\{r_n\}$ are twoo sequences of rational numbers both converging to $x$ then the sequences $\{b^{q_n}\}$ and $\{b^{r_n}\}$ both converge to the same real number.
We define $b^x$ as $\lim_{n\to \infty} b^{q_n}$.
In my opinion this definiton makes the most intuitive sense.  However it is the less common definition.  Probably because it is a lot harder than it looks and also it takes quite a bit of work to figure out the natural exponents and logarithms or the notion that the derivative of the natural log is $\frac 1x$.
Post-script: As Martin Agerami points out in a comment. Another issue of the process of defining
$b^n; n\in \mathbb Z; n\ge 2$ as $\underbrace{b\times....\times b}_{n\text{ times}}$ which is clearly well defined (and which as a consequence means $b^{n+m}=b^nb^m$ and $(b^n)^m=b^{nm}$).
$b^0 = 1; b^1 =b$ for consistency and for negative values $b^{-n}=\frac 1{b^n}$ which is alwo well-defined.
And $b^{q}; q\in \mathbb Q; q=\frac mn; m,n\in \mathbb Z;n> 0$ as $\sqrt[n]{b}^m$ with the understanding that $b$ is either positive of if $b < 0$ that $m$ is odd; ... this has immediate issues (not insurmountable but issues nonetheless) that we have to prove roots actually exist (its not a given) and that if $q =\frac mn=\frac ac$ that $\sqrt[n]{b}^m=\sqrt[b]{b}^c$ (which turns out to be true if $b$ is positive but not if $b$ is negative)
It's a little weird in that the, to me, intuitive and straightforward definitions have issues, that to be solved requires knowledge of continuity.  But once one has the knowledge to address the issues, it turns out wiping the slate clean and creating a definition based on that knowledge but completely different in apperence is actually better and easier.
A: You can define $2^x$ as $\exp\bigl(x\log(2)\bigr)$. Another possibility is to take a sequence $(q_n)_{n\in\mathbb N}$ of rational numbers such that $\lim_{n\to\infty}q_n=x$ and to define $2^x$ as $\lim_{n\to\infty}2^{q_n}$. It can be proved that this limit does not depend upon the choice of the sequence $(q_n)_{n\in\mathbb N}$.
A: 
But since function f is continuous on R ( the set of real numbers), it must also be defined when the exponent x is not a rational number, and hence cannot be written as a fraction.
So for example, how is f(π)=2π defined?

You just answered your own question. Its continuity defines its values; it's defined as the continuous extension to the real numbers.
Given any set, a function being continuous on that set means that it is uniquely determined by its values on a dense subset. The rationals are dense in the reals, so the values of any function on the rationals defines its values on the reals. So the premise that $f$ is continuous serves to define its values on the reals.
We can simply, for each $\epsilon > 0$, take an open neighborhood with measure less than or equal to $\epsilon$ containing $\pi$, then let $\epsilon$ go to zero. Since the rationals are dense, every neighborhood will have rationals in it, and we can approximate $f(\pi)$ by the value of $f$ at those rationals. Since $f$ is continuous, the difference between the maximum and minimum of $f$ over those rationals goes to zero as $\epsilon$ does.
From a CS point of view, a computer program can only output a finite number of digits, so we can't define a "function" as requiring that for each input, the "exact" value be given; we can require only that for any input and level of precision, an output to that level of precision can be given. A continuous function can be thought of as a function for which this is "good enough"; by definition, if a function is continuous, then for any input and level of precision in the output, there is some level of precision in the input such that any input with that level of precision results in the required level of precision in the output. A computer program working only in floating point numbers (a subset of the rationals that is still dense) can give the value of $2^{\pi}$ to arbitrary precision. If reals are represented by sequences of digits, we can find the sequence of digits representing $2^{\pi}$ by simply finding $2^{\pi}$ to a precision of $10^{-1}$, then  $10^{-2}$, etc.
We can even do continuous extensions in a general topological space, without reference to metric: take the intersection of all closures of images of open neighborhoods that contain $x_0$. This can be shown to be a singleton, and thus $f(x_0)$ can be defined as its sole member.
A: Let $\{a_n\}$ be a sequence of rational numbers such that $$\lim _{n\to \infty }  a_n=\sqrt 5$$
Define $$2^{\sqrt 5 } = lim _{n\to\infty} 2^{a_n}$$
It remains to show that the sequence is convergent and the limit does not depend on the initial rational sequence approaching $\sqrt 5$ 
