\documentclass[a4paper,11pt]{article}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{amsmath}
\usepackage{mathtools}



\begin{document}

\begin{equation}
\label{eq:rownowaznosc3}
\mathrlap{\underbrace{\phantom{p \Longleftrightarrow q}}_
{\mathclap{p \Rightarrow q \wedge q \Rightarrow p}}}
p \Longleftrightarrow \overbrace{q \Longleftrightarrow r}^
{\mathclap{q \Rightarrow r \wedge r \Rightarrow q}}
\end{equation}

\end{document}