Is there a difference infinite sequences and functions? Is there a difference infinite sequences (all elements are natural numbers) and functions ? 
I mean for example,

Is the infinite sequence $$a_n=\left\{0,1,0,1,0,1 \cdots \right\}$$ equal to $$f(n) = \frac 12 ((-1)^n + 1) ? $$

 A: There is not. Most people define sequences as functions from the natural numbers, $0,1,2,3,\ldots$ 
You can see this on the Wikipedia page and in almost any "higher level" mathematics textbook which defines sequences.
In your notation, instead of $a_{n}$ some authors may even write $a(n)$ to make this clear.
A: Commonly an infinite sequence is a function whose domain is the set of natural numbers  and its range is the set of real or complex numbers. 
In general any function with a countable domain is a sequence.
Thus your sequence is  the same as $$f:\Bbb {N} \to \Bbb{R} $$
Defined by $$f(n)=\frac {(-1)^n+1}{2}$$
A: Well, yes and no but mostly yes.
If you have sequence $\{a_1, a_2, a_3, a_4, .....\}$ where the $a_i$ are all elements of some set $X$ ($X$ can be any set; if it's easier you can assume $X =\mathbb R$)  and you have a function $f:\mathbb N \to X$ sot that $f(n) = a_n$ that is perfectly well defined.  (ALso you can define your sequence as $\{a_k\} = \{f(k)\}$).  So there doesn't seem to be any difference.  
And indeed: One can think of it as sequence is function mapping each index to a term.  That seems to encapsulate the essence of both functions and sequences, doesn't it?
.......
If you want to get technical what is a function and what is a sequence?  Well... technically a function $f:X \to Y$  is a set of ordered pairs $f = \{(x_\alpha, y_\alpha)\}$ where each $x_\alpha \in X$ and each $y_\alpha \in Y$ and for every $x \in X$ there is exactly one ordered pair in $f$ where the first term is equal to $x$.
And what is a sequence.  If is an ordered set of elements in a set $Y$ where every term has distinct natural number index and there is a term for each natural number.  In other words is set of $\{(i, y_i)\}$ ordered pairs were each $i \in \mathbb N$ and $y_i \in Y$ and there for every natural number there is exactly one $y_i$.
In other words.... its a function from $\mathbb N \to X$.
.....
But a sequence is a function with domain $\mathbb N$.  If you had a function with an uncountable domain such as $\mathbb R$ then you can not list it as a sequence.
