Q:

Domain and range

I would like to draw in TeX the following, but I'm pretty new at tikz therefore I have no clue. 
I would like to give the geometrical interpretation of the domain and the range of a function. 
That is that every element of the function that is defined on that has an image on the axis x'x , and that every element that is evaluated on that particular x, has an image on y'y. 
How do I do that?  I would also like to have some arrows indicating the whole process. 
Question: Why can I not write the math symbols in LaTeX here? 

(source: ebooks.edu.gr) 
Edit: I want to draw the first two pictures in Tikz, not the third one!  Hope this helps. 
Thank you in advance. 
Any help would be appreciated. 

A:

Not the most elegant code, there's a bit of trial and error and code repetition, but it does the job. 

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{intersections,backgrounds}
\begin{document}

\begin{tikzpicture}

\draw [thick,-stealth] (-0.5,0) --node[below]{$A$} (4,0) node[below]{$x$};
\draw [thick,-stealth] (0,-0.5) -- (0,3) node[left]{$y$};
\node [below left] at (0,0) {$0$};

\draw [ultra thick, red] (0.5,0) -- (3.5,0);

\coordinate (start) at (0.499,0.7);
\coordinate (stop) at (3.501,2.5);

\fill (start) circle[radius=2pt];
\fill (stop) circle[radius=2pt];
\draw [name path=curve] (start) to[out=-35,in=190] node[pos=0.6,above left] {$C_f$} (stop);

\foreach \x in {0.5,1,...,3.5}
  {
  \path [name path=line] (\x,0) -- (\x,3);
  \draw [name intersections={of=curve and line},dashed,-stealth]
   (intersection-1) -- (\x,0);
 }

\begin{scope}[xshift=6cm]
\draw [thick,-stealth] (-0.5,0) --  (4,0) node[below]{$x$};
\draw [thick,-stealth] (0,-0.5) --node[left]{$f(A)$} (0,3) node[left]{$y$};
\node [below left] at (0,0) {$0$};

\draw [ultra thick, red] (0,0.52) -- (0,2.5);

\coordinate (start) at (0.499,0.7);
\coordinate (stop) at (3.501,2.5);

\fill (start) circle[radius=2pt];
\fill (stop) circle[radius=2pt];
\draw [name path=curve] (start) to[out=-40,in=190] node[pos=0.6,below right] {$C_f$} (stop);

\foreach \y in {0.52,.916,...,2.5}
  {
  \path [name path=line] (0,\y) -- (4,\y);
  \draw [name intersections={of=curve and line},dashed,-stealth]
   (intersection-1) -- (0,\y);
 }

\end{scope}

\end{tikzpicture}
\end{document}

A:

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{positioning,calc}
\begin{document}
  \begin{tikzpicture}
    \coordinate (O) at (0,0);
    \draw[-latex] (-1,0) node[below right = 0mm and 5mm] {$O$} --
            node[pos=0.55,below]{$A$} (10,0)node[pos=0.99,below] {$x$};
    \draw[-latex] (0,-1)  -- node[pos=0.99,left] {$y$}(0,8);
    \node[fill,circle,inner sep=2pt] (a) at (2,3) {};
    \node[fill,circle,inner sep=2pt] (b) at (8,6) {};
    \foreach \x [count=\y]in {0,0.05,...,1.05}{
    \draw (a.center) to [out=-45, in=180]node[pos=\x] (\y){}
           node[pos=0.5,above=1mm]{$C_{f}$} (b.center)
     ;
     \draw[dashed,-latex] (\y) -- (\y|-O);
     \draw[very thick,red] (a|-O) -- (b|-O);
    }
    \node at (5,-1) {($\alpha$)};

    \begin{scope}[xshift=12cm]
      \coordinate (O) at (0,0);
    \draw[-latex] (-1,0) node[below right = 0mm and 5mm] {$O$} --
             (10,0)node[pos=0.99,below] {$x$};
    \draw[-latex] (0,-1)  -- node[pos=0.55,left]{$f(A)$} node[pos=0.99,left] {$y$}(0,8);
    \node[fill,circle,inner sep=2pt] (a) at (2,3) {};
    \node[fill,circle,inner sep=2pt] (b) at (8,6) {};
    \foreach \x [count=\y]in {0,0.1,...,1.05}{
    \draw (a.center) to [out=-45, in=180]node[pos=\x] (\y){}
           node[pos=0.5,below=1mm]{$C_{f}$} (b.center);
     \draw[dashed,-latex] (\y) -- (\y-|O);
     \draw[very thick,red] (4-|O) -- (b-|O);
    }
    \node at (5,-1) {($\beta$)};
    \end{scope}
  \end{tikzpicture}
\end{document}

A:

\documentclass[pstricks,border=20pt,12pt]{standalone}
\usepackage{pst-plot,pst-node}
\psset
{
    algebraic,
    ticks=none,
    labels=none,
    xAxisLabel=$x$,
    yAxisLabel=$y$,
    saveNodeCoors,
}

\def\f{-2*sin(3*x/4-1/4)+2.5}

\begin{document}
% a
\begin{psgraph}{->}(0,0)(-.5,-.5)(7,5){10cm}{!} 
    \psplot[arrows=*-*]{1}{6}{\f}
    \uput[-135](0,0){$O$}
    \uput[-90](3.5,0){$A$}
    \fnpnodes[plotpoints=10]{1}{6}{\f}{P}
    \multido{\i=0+1}{\numexpr\Pnodecount+1}{\psline[linestyle=dashed]{<-}(P\i|0,0)(P\i)}
    \uput[180](P6){$C_f$}
    \psline[linecolor=red,linewidth=2\pslinewidth](P0|0,0)(P\Pnodecount|0,0)
\end{psgraph}

% b
\begin{psgraph}{->}(0,0)(-.5,-.5)(7,5){10cm}{!} 
    \psplot[arrows=*-*]{1}{6}{\f}
    \uput[-135](0,0){$O$}
    \uput[180](0,2.5){$f(A)$}
    \fnpnodes[plotpoints=12]{1}{6}{\f}{P}
    \multido{\i=0+1}{\numexpr\Pnodecount+1}{\psline[linestyle=dashed]{->}(P\i)(0,0|P\i)}
    \uput[0](P6){$C_f$}
    \psline[linecolor=red,linewidth=2\pslinewidth](0,0|P3)(0,0|P\Pnodecount)
\end{psgraph}

% c
\begin{psgraph}{->}(0,0)(-.5,-.5)(7,5){10cm}{!} 
    \psplot[arrows=*-*]{1}{6}{\f}
    \uput[-135](0,0){$O$}
    \pnode(*4 {\f}){A}
    \psxTick(N-A.x){x_0}
    \psyTick(N-A.y){f(x_0)}
    \psCoordinates[linestyle=dashed](A)
    \uput[0](A){$A(x_0,f(x_0))$}
    \pcline[linestyle=dashed](A)(A|*5 {\f})\ncput[npos=1.2]{$x=x_0$}
\end{psgraph}
\end{document}

