سلام
روش اول: با استفاده از GeoGebra
\documentclass[12pt,a4paper]{report}
\usepackage{pgf,tikz}
\begin{document}
\definecolor{ffffff}{rgb}{1.,1.,1.}
\definecolor{ffqqtt}{rgb}{1.,0.,0.2}
\begin{tikzpicture}[>=triangle 90,x=1.0cm,y=1.0cm]
\draw[->,color=black] (-3.,0.) -- (3.,0.);
\foreach \x in {-2,-1,1,2}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0.,-5.) -- (0.,5.);
\foreach \y in {-4,...,-1,0,1,2,3,4}
\draw[shift={(0,y)},color=black] (.2pt,0pt) -- (-12pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
\draw [color=ffqqtt,thick] (0.,0.)-- (1.,1.);
\draw [color=ffqqtt,thick] (1.,2.)-- (2.,3.);
\draw [color=ffqqtt,thick] (-1.,-2.)-- (0.,-1.);
\draw [color=ffqqtt,thick] (-2.,-4.)-- (-1.,-3.);
\draw [dashpattern=on 3pt off 3pt,color=ffqqtt,thick] (-1.,-3.) -- (-1.,-2.);
\draw [dashpattern=on 3pt off 3pt,color=ffqqtt,thick] (0.,-1) -- (0.,0);
\draw [dashpattern=on 3pt off 3pt,color=ffqqtt,thick] (1.,1) -- (1.,2);
\begin{scriptsize}
\draw [red,fill=ffqqtt,thick] (-2.,-4.) circle (2.5pt);
\draw [red,fill=ffffff,thick] (-1.,-3.) circle (2.5pt);
\draw [red,fill=ffqqtt,thick] (-1.,-2.) circle (2.5pt);
\draw [red,fill=ffffff,thick] (0.,-1.) circle (2.5pt);
\draw [red,fill=ffqqtt,thick] (0.,0.) circle (2.5pt);
\draw [red,fill=ffffff,thick] (1.,1.) circle (2.5pt);
\draw [red,fill=ffqqtt,thick] (1.,2.) circle (2.5pt);
\draw [red,fill=ffffff,thick] (2.,3.) circle (2.5pt);
\end{scriptsize}
\end{tikzpicture}
\end{document}
روش دوم:
\documentclass[a4paper,12pt]{report}
\usepackage{tikz,amsmath,color}
\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}
\begin{document}
\begin{center}
\begin{tikzpicture}[>=latex,thick]
\draw [thick,->](-3,0)--(3,0);
\draw (0,-5)--(0,-1.07);
\draw[->] (0,-.93)--(0,5);
\foreach \x/\xtext in {-2,-1,1,2,}
\draw (\x,-.1)--(\x,.1);
\foreach \y/\ytext in {-4,...,-1,1,2,3,4}
\draw (-4,\y) node{$\ytext$};
\foreach \y in {-4,-3,-2,1,2,3,4}
\draw (-1,\y)--(.1,\y);
\foreach \x in {-2,-1,0,1}
\draw [blue,fill=blue](\x,2*\x) circle (0.07cm);
\foreach \x in {-1,0,1,2}
\draw [blue](\x,\x-1) circle (0.07cm);
\foreach \x in {-1,0,1}
\draw [dashed,blue](\x,\x-.93)--(\x,\x);
\foreach \x in {-2,-1,0,1}
\draw [blue] (\x,2*\x)--(\x+.96,\x+.96);
\node at (0,5.2) {$y=x+[x]$};
\end{tikzpicture}
\end{center}
\end{document}
توجه: وارون تابع را در صورت وجود، خودتان رسم کنید!