This is an exercise from the book Algebraic Graph Theory by Godsil and Royle.
Show that in a bipartite graph, any cycle of length equal to the girth is a retract.
We say that a subgraph $Y$ of $X$ is a retract, if there is a homomorphism $f:X\to Y$ such that $f|Y$ is the identity map.
I have no idea how to approach this, I can gather a few things from the graph being bipartite, such as that the girth must be even, or that there is a homomorphism from it to $K_2$. But I'm having a hard time piecing it together.
Hint: consider a vertex on the minimum length cycle, and label the other vertices of the graph by their distance from it. See if you can use this to define a retraction. (Basically, use the previous exercise in the book).
You may also find it helpful to know that, if $u$ is any vertex of a connected bipartite graph, then the vertices even distance from $u$ are one partite set of $G$, and the vertices odd distance from $u$ are the other partite set.
Proof sketch: