continuity, discontinuity examples of functions i. I need to find a function from R to R discontinuous  at the even integers 
 A: For the second part it is possible to find a function like the following
$$f(x)= \begin{cases} x, & x \in \Bbb{R}\setminus \Bbb{Q} \\
  2k & x \in [2k-1,2k+1)\cap \Bbb{Q} , \forall k \in\Bbb{Z} \end{cases} $$

In general, if you have two functions $f,g : \Bbb{R} \to \Bbb{R}$ then the function
$$ h(x)=\begin{cases} f(x) & x \in \Bbb{Q} \\ g(x) & x \in \Bbb{R}\setminus \Bbb{Q} \end{cases} $$
is continuous at $x_0$ if $f,g$ are both continuous at $x_0$ and $f(x_0)=g(x_0)$.
A: Try drawing a few graphs. A graph immediately makes it clear that $\lfloor 2x\rfloor$ won’t work for your first problem: it jumps at $0,\frac12,1,\frac32,\dots$. However, there is a simple $\alpha$ such that the function $f(x)=\lfloor\alpha x\rfloor$ works, and it shouldn’t be too hard to find. Your other suggestion $-$ the characteristic function of the set of even integers $-$ does work, and it is not be at all difficult to prove this.
Your second problem is indeed harder. Here’s a big HINT. Start with a function that is continuous at just one point, say at $x=0$. Given these exercises, I suspect that you’ve seen one, but if not, the function $$f(x)=\begin{cases}x,&\text{if }x\text{ is rational}\\0,&\text{if }x\text{ is irrational}\end{cases}\tag{1}$$ is a pretty standard example. Now take the graph of this $f$ over the interval $[-1,1)$ and copy it left and right to make a periodic function with period $2$. At every even integer that periodic function will look just the way $(1)$ does at $x=0$. Writing down the details of the definition of this periodic function is a fairly straightforward exercise that I leave to you.
